0 thích 0 k thích
6.4k đã xem

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
[Exam] đã hỏi trong Mid-term examination bởi (5.9k điểm)
ID: 32690 - Xem được từ: Không giới hạn - Hiệu lực đến: 2017-11-15 16:10
| 6.4k đã xem

21 Trả lời

0 thích 0 k thích
Hidden content!
#include * * * * *

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

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

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

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

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

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

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

* * * * ** ***** ** 0;
}
100/100 trả lời bởi (192 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
#include * * ** *

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

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

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

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

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

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

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

* * ******* * ** * 0;
}
100/100 trả lời bởi (183 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
#include * *** * * *

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

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

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

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

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

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

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

* ** * ***** * * ** ** * * 0;}
100/100 trả lời bởi (244 điểm)
đã sửa bởi
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 thích 0 k thích
Hidden content!
#include * ***** ** *

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

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

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

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

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

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

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

return 0;
}
100/100 trả lời bởi (153 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
* *** * * * * * *

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

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

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

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

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

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

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

return 0;
}
100/100 trả lời bởi (243 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
int main(int argc, char *argv[]) {

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

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

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

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

else if **** *****
* * **** ** **** *** ** *** ** * * *
* * ******* ** ** * 0;
}
1/100 trả lời bởi (449 điểm)
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 thích 0 k thích
Hidden content!
#include *** * **** *



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

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

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

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

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

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

** *** * * * ** * **** ** ** 0;
}
100/100 trả lời bởi (283 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
#include ** * ** *

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

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

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

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

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

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

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

**** *** ** * *** 0 ;
}
100/100 trả lời bởi (269 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
#include * ** ** *****

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

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

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

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

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

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

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

*** * * *** * * * ** 0 ;
}
100/100 trả lời bởi (254 điểm)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 thích 0 k thích
Hidden content!
#include **** ** * *** *

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

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

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

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

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

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

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

****** * ** * * ** *** 0;
}
100/100 trả lời bởi (220 điểm)
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:104.23.243.108
©2016-2026

Những câu hỏi liên quan

0 thích 0 k thích
21 trả lời
[Exam] đã hỏi ngày 15 tháng 11 năm 2017 trong Mid-term examination bởi nat236919 (5.9k điểm)
ID: 32695 - Xem được từ: Không giới hạn - Hiệu lực đến: 2017-11-15 16:10
| 6.8k đã xem
0 thích 0 k thích
19 trả lời
[Exam] đã hỏi ngày 14 tháng 11 năm 2017 trong Mid-term examination bởi nat236919 (5.9k điểm)
ID: 32015 - Xem được từ: Không giới hạn - Hiệu lực đến: 2017-11-15 16:30
| 5.6k đã xem
0 thích 0 k thích
22 trả lời
[Exam] đã hỏi ngày 14 tháng 11 năm 2017 trong Mid-term examination bởi nat236919 (5.9k điểm)
ID: 31995 - Xem được từ: Không giới hạn - Hiệu lực đến: 2017-11-15 16:10
| 3.6k đã xem
0 thích 0 k thích
22 trả lời
[Exam] đã hỏi ngày 14 tháng 11 năm 2017 trong Mid-term examination bởi nat236919 (5.9k điểm)
ID: 31983 - Xem được từ: Không giới hạn - Hiệu lực đến: 2017-11-15 16:10
| 3.8k đã xem
0 thích 0 k thích
21 trả lời
[Exam] đã hỏi ngày 14 tháng 11 năm 2017 trong Mid-term examination bởi nat236919 (5.9k điểm)
ID: 31979 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 3.7k đã xem
12,783 câu hỏi
183,442 trả lời
172,219 bình luận
4,824 thành viên