0 喜歡 0 不喜歡
3.5k 瀏覽

11. There are some mistakes in the code, please fix them by using your compiler, and post your code here.

(can be answered 2 times)

#include <stdio.h>

int main(int argc, char *argv[]) {

int country_code;
scanf ("%d", &country_code);

if (country_code==886){
    printf("Taiwan");
}

else (country_code==976){
    printf("Mongolia");
}

else if (country_code==62){
    printf("Indonesia");
}

else if (country_code==66){
    printf("Thailand");
}

else
    printf("No");

    return 0
[考試] 最新提問 分類:Mid-term examination | 用戶: (5.9k 分)
ID: 32690 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 3.5k 瀏覽

21 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include *** *

int main(int argc, char *argv[]) {

int ** ***
scanf * * * ** * **** * **

if **** * **
**** * ******** ******** ** ** *** ****
}

else if * ** * *
* ** * *** * ** * *** *** * ** *
}

else if ** ** *
** **** ** ** * *** **** *** *** *** *
}

else if * ** *** ***
* * * ** * *** ** * ** * *** **
}

else
* **** * **** * * * *** *** * * **

** * * * * * * ** ** 0;
}
100/100 最新回答 用戶: (192 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** *** **** *

int main(int argc, char *argv[]) {

int ***
scanf * ** * * *** *** * ** *

if ***** * * * ** *
* ***** * * * ** * * *** ** * * * **
}

else if *
* ** * ** **** ** **** **** * **** * * **
}

else if * ***** ** *
* *** * * ** ** **** ** * * **** ** ** *
}

else if ** * * * *
** * * * * * *** * *** ****** * **
}

else
* **** * ** * ** * *** * * ***** **

* * * ****** ** ** * ***** *** ** 0;
}
100/100 最新回答 用戶: (183 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include **** * **

int main(int argc, char *argv[]) {

int *** * *
scanf **** *** * * * * ******

if ** **
* * * * ** * * ** * ** ** ** *
}

else *** ** * *** *
*** * * * ***** * ** ** **** * **** ** * **
}

else if * * * * **
** ** * * * ** * ** * * * *** ** * **
}

else if *** * ***
*** * * * * ***** * ** *** ** * * **** * * * ***
}

else
* * **** ** *** * * ** **** **

* ********* ** * * 0;}
100/100 最新回答 用戶: (244 分)
修改於 用戶:
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * * ** *******

int main(int argc, char *argv[]) {

int * * * *
scanf **** ** * ***** *** * * ** * *

if ** * **** *
**** *** * *** ** * **** ** * ** ** **** ** *

}else **** ***
* *** ***** * * * * * * * ** * * * * * **

}else * * * * *
* ** * *** ** * **** * * *
}

else if * ****** *
***** **** ** * *** * * *** ** * ****
}

else
** ** * * * * * * * **** * *** **** *

return 0;
}
100/100 最新回答 用戶: (153 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
** ******** *

int main(int argc, char *argv[]) {

int * *** ***
scanf **** * ** * *** * * *

if * * *
** * ** * * * * * ***** **
}

else * ** *
* * ** * * * ** ** **** * ** * * * ***
}

else if ** * **
** * ** ** ** *** * * * * * *** * * *
}

else if * *****
* * * * **** ** * ********** * ** * * * ****
}

else
** ** * * * ** *** * ** * * ** *

return 0;
}
100/100 最新回答 用戶: (243 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
int main(int argc, char *argv[]) {

int ** *** * * *
scanf * * **** * **** * **** ** * *

if ** ***
* *** * **** * * ** * **** ** *** * *
}

else ** **** * *** *
* * *** ** * *** * ** ** * ** ** **
}

else if * * **
** * *** * ** * * *** ***** * * ***** ** *** * ***
}

else if * * ** ****
* ** *** **** *** ** ** ** ** * *** * **
***** ** *** ** 0;
}
1/100 最新回答 用戶: (449 分)
0 0
prog.c: In function 'main':
prog.c:4:1: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
 scanf ("%d", &country_code);
 ^~~~~
prog.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf'
prog.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
prog.c:7:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
     printf("Taiwan");
     ^~~~~~
prog.c:7:5: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:7:5: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c:10:25: error: expected ';' before '{' token
 else (country_code==976){
                         ^
prog.c:21:1: error: expected declaration or statement at end of input
 }
 ^
0 喜歡 0 不喜歡
內容已隱藏
#include * * * * ** *



int main(int argc, char *argv[]) {

int *** * *
scanf * *** *** * *** * **

if ** * **
** * * ***** * *** **** ** * * ** *
}else if * *** * **
*** ** ***** ** ** * * * * **** * * ** *
}

else if * *** ****
* * * * * * * * *** ** * * ****** *
}

else if * ***
* * * ** *** * **** * ****** * ** ** *** **
}

else
* ***** ****** *** * ****** * * * ** **

* * * **** * * * * *** * * * * 0;
}
100/100 最新回答 用戶: (283 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * * *** *

int main(int argc, char *argv[]) {

int *** **
scanf * *** *** * **** * **** *

if ***** ** *
** *** ** * ** ** ** *** ***** * **
}

else if *** **
* * **** * * * ** ** * * **
}

else if *** * ****
* * ** * ***** *** * *** * **** ** * * *
}

else if **** ***
* ****** ***** ** ***** * * * ** * * * * *
}

else
* ** ***** *** **** * ** *** ** **

*** * ******* * ** **** 0 ;
}
100/100 最新回答 用戶: (269 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include **** * ***

int main(int argc, char *argv[]) {

int * * **
scanf ** * * **** * * * *** * * *

if * ** ***
* *** ****** *** ** ******* * ** * ****
}

else if * ** *
** * ** ** ** *** * * ** ***** * ***
}

else if * ****** * ** *
* * ** * * *** **** * ** * * *** *** * *
}

else if * * ** ** *
*** ** ** * * *** ** * * * **
}

else
* * ***** * ** *** **** ** * ***

* **** ******* * * * * ** 0 ;
}
100/100 最新回答 用戶: (254 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include ** * ***

int main(int argc, char *argv[]) {

int *** * *
scanf * ****** ** **** * * **

*** * ** * ** *** *
* ** ** * * ** ** ** ** **** ** **** * ** * **
}

else if * * **
** * * * * * *** * * * **** * * * *
}

else if * * ******
* * ***** * * * * ***** * ** ** **
}

else if ** * * *
* * *** ** ** *** *** * *** * * * ***
}

else
* * ** **** ******** * *** * * * ** * ** ** *

* * ** * * *** ** * *** 0;
}
100/100 最新回答 用戶: (220 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.130.213
©2016-2025

相關問題

0 喜歡 0 不喜歡
21 回答
[考試] 最新提問 11月 15, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 32695 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 3.3k 瀏覽
0 喜歡 0 不喜歡
19 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 32015 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:30
| 2.9k 瀏覽
0 喜歡 0 不喜歡
22 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31995 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 1.9k 瀏覽
0 喜歡 0 不喜歡
22 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31983 - 從幾時開始: 無限制 - 到幾時結束: 2017-11-15 16:10
| 1.9k 瀏覽
0 喜歡 0 不喜歡
21 回答
[考試] 最新提問 11月 14, 2017 分類:Mid-term examination | 用戶: nat236919 (5.9k 分)
ID: 31979 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 1.8k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶