嗨即時新在這裏也是即時通訊新編程和id像你一樣幫助我:問題是編譯和運行程序後,它停止在它的中間運行和我不知道是什麼原因造成這一點,比較遺憾的是無法讀取以前的帖子: 這裏是我的程序:C程序在運行中停止
char answer[15];
char place[15];
char fullname[15];
int age;
printf("What Is Your Full Name?: ");
scanf("%s",fullname);
printf("What Is Your Age?: ");
scanf("%d",age);
printf("Where Do You Live?: ");
scanf("%s",place);
if(strcmp(place,"gafsa")==0) {
printf("Aint a bad place you know");
}
else{
printf("hmmm %s cool\n",place);
}
printf("your name is %s, %d year old from %s is that right?: ",fullname,age,place);
scanf("%s",answer);
if(strcmp(answer,"yes")==0){
printf("you my friend are awesome\n");
}
else{
printf("you suck\n");
}
,這是清楚地表明瞭該問題的圖像:
http://i.stack.imgur.com/yFTwK.png
你嘗試調試? –
請打開你的編譯器的警告並閱讀它們。 – Mat
...和縮進 –