谁能帮我编辑一个C语言程序??

来源:百度知道 编辑:UC知道 时间:2024/05/14 05:57:42
题目是:请编写一个完整的程序,用函数int jsValue(int b[])实现:在三位数中寻找符合条件的整数,,并依次从小到大排列存如数组b[]中;所找的整数既是完全平方数,又有2位数字相同,例如144,676等,将这些整数的个数通过所编辑的函数返回,最后调用函数writeDat()把结果输入文件out.dat中.

3Q~~

8月30日 10:22 #include <stdio.h>
#include <string.h>
#define LEN_SHANG sizeof(struct node_shang)
#define LEN_YUSHU sizeof(struct node_yushu)

struct node_shang {/*商结点*/
char data;
struct node_shang *next;
} *shang_head=0, *shang_tail=0;

struct node_yushu {/*余数结点*/
long data;
struct node_yushu *next;
} *yushu_head=0, *yushu_tail=0;

int shang_empty(void) {/*判断商串是否空*/
return shang_head==0;
}
int yushu_empty(void) {/*判断余数串是否空*/
return yushu_head==0;
}
struct node_shang *new_shang_node(char ch) {/*新建商的结点*/
struct node_shang *ptr= (struct node_shang *) malloc(LEN_SHANG);
ptr->data=ch;
ptr->next=0;
return ptr;
}
struct node_yushu *new_yushu_node(long a) {/*新建余数结点*/
struct node_yushu *ptr= (struct node_yushu *) malloc(LEN_YUSHU);
ptr->data= a;
ptr->next=0;
return ptr;
}
void insert_shang(char ch) {/*插入商字符