#10204: 可以問問哪邊錯了嗎???


cy335009 (幼兒)

學校 : 不指定學校
編號 : 51310
來源 : [210.70.10.203]
最後登入時間 :
2015-09-04 17:29:35
a002. 簡易加法 | From: [1.175.133.148] | 發表日期 : 2015-09-04 07:02

int a,b;

printf("enter nember: ");

scanf("%d   %d",&a,&b);

 

printf("%d",a+b);

求神解救

 

 

 

第 1 測資點(10%): CE () 
編譯錯誤 

/code_2438557.c:2:8: error: expected declaration specifiers or ‘...’ before string constant
 printf("enter nember: ");
        ^
/code_2438557.c:3:7: error: expected declaration specifiers or ‘...’ before string constant
 scanf("%d   %d",&a,&b);
       ^
/code_2438557.c:3:17: error: expected declaration specifiers or ‘...’ before ‘&’ token
 scanf("%d   %d",&a,&b);
                 ^
/code_2438557.c:3:20: error: expected declaration specifiers or ‘...’ before ‘&’ token
 scanf("%d   %d",&a,&b);
                    ^
/code_2438557.c:4:8: error: expected declaration specifiers or ‘...’ before string constant
 printf("%d",a+b);
        ^
/code_2438557.c:4:13: error: expected declaration specifiers or ‘...’ before ‘a’
 printf("%d",a+b);
             ^
 
#10429: Re:可以問問哪邊錯了嗎???


lunlun04 (拉拉拉拉拉~~~0.<)

學校 : 臺北市立中正高級中學
編號 : 54082
來源 : [114.24.50.194]
最後登入時間 :
2016-03-18 12:20:21
a002. 簡易加法 | From: [203.72.62.253] | 發表日期 : 2015-11-05 12:49

int a,b;

printf("enter nember: ");

scanf("%d   %d",&a,&b);

 

printf("%d",a+b);

求神解救

 

 

 

第 1 測資點(10%): CE () 
編譯錯誤 

/code_2438557.c:2:8: error: expected declaration specifiers or ‘...’ before string constant
 printf("enter nember: ");
        ^
/code_2438557.c:3:7: error: expected declaration specifiers or ‘...’ before string constant
 scanf("%d   %d",&a,&b);
       ^
/code_2438557.c:3:17: error: expected declaration specifiers or ‘...’ before ‘&’ token
 scanf("%d   %d",&a,&b);
                 ^
/code_2438557.c:3:20: error: expected declaration specifiers or ‘...’ before ‘&’ token
 scanf("%d   %d",&a,&b);
                    ^
/code_2438557.c:4:8: error: expected declaration specifiers or ‘...’ before string constant
 printf("%d",a+b);
        ^
/code_2438557.c:4:13: error: expected declaration specifiers or ‘...’ before ‘a’
 printf("%d",a+b);
             ^

其實不用輸出多餘的字"enter number"


 
ZeroJudge Forum