是用VS2019写的C语言程序,第一组输入的可以,第二个却出了问题。
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
main() {
int fuc(int c2, int arry1[100], int arry2[100], int nrry[10000], int r, int w);
char u[199], a[398] = { ' ' };
char w[199], v[398] = { ' ' };
int b[100], g[100], j0 = 1, j1 = 1;
gets_s(w, 198); strcat_s(v, 398, w);
gets_s(u, 198); strcat_s(a, 398, u);
for (int z = 1; z <= 198; z++)
if (v[z] != ' ') {
g[j0] = atoi(v); j0 += 1; for (int t = z; t <= 198; t++) {
if (v[t] == ' ' || v[t] == '\0') {
for (int x = z; x <= t; x++) {
v[x] = ' ';
} break;
}
}
}
for (int i = 1; i <= 6; i++)
printf("%d \b", g[i]);
/*
for (int z = 1; z <= 198; z++)
if (a[z] != ' ') {
b[j0] = atoi(a); j0 += 1; for (int t = z; t <= 198; t++) {
if (a[t] == ' ' || a[t] == '\0') {
for (int x = z; x <= t; x++) {
a[x] = ' ';
} break;
}
}
}
for (int i = 1; i <= 6; i++)
printf("%d \b", b[i]);*/
启用第二个数组输入代码(删掉“/**/)结果却是