11/11/24 10:06:41.81
>>605
こういう事?
#include <stdio.h>
int main(void){
char str[3][20], s[100];
int i, w;
printf("3つの文字列を入力して下さい(例:abc defgh ijkl)¥n");
fgets(s, sizeof(str[i]), stdin);
w = sscanf(s, "%s %s %s", str[0], str[1], str[2]);
printf("¥n");
for (i = 0; i < 3 && i < w; i++)
printf("入力した文字列の%d番目は%sです¥n", i, str[i]);
return 0;
}