请问一下 各位
我要考三级 网络技术,得机试C语言 试题目难度如下 请问我还需要学 谭浩强的C程序设计那几章?我已经学了1-6章了 #include <conio.h>#include <stdio.h>
void readwriteDat();
void num(int m, int k, int xx[])
{
int data = m+1;
int half, n = 0, i;
while(1)
{
half = data/2;
for (i=2; i<=half; i++)
if (data%i == 0)
break;
if (i > half)
{
xx[n] = data;
n++;
}
if (n >= k)
break;
data++;
}
}
main()
{
int m, n, xx[1000];
printf("\nPlease enter two integers:");
scanf("%d%d", &m, &n);
num(m, n, xx);
for (m=0; m<n; m++)
printf("%d ", xx[m]);
printf("\n");
readwriteDat();
}
void readwriteDat()
{
int m, n, xx[1000], i;
FILE *rf, *wf;
rf = fopen("in.dat", "r");
wf = fopen("out.dat", "w");
for (i=0; i<10; i++)
{
fscanf(rf, "%d %d", &m, &n);
num(m, n, xx);
for (m=0; m<n; m++)
fprintf(wf, "%d ", xx[m]);
fprintf(wf, "\n");
}
fclose(rf);
fclose(wf);
}