1 thích 0 k thích
2.9k đã xem

Please take a look at the uncompleted program in the bottom and fill in the gaps to complete the program in order to display the following output:
Remember: Direct output or cheated output is always forbidden. TA always see your code after the OnlineJudge.

-12.123
-12.123456789
 -12.123456789
-12.123457
-12.12346
-12



Source Code:

#include <stdio.h>
int main()
{
    double x = -12.123456789;
    printf("______________\n", x);
    printf("______________\n", x);
    printf("______________\n", x);
    printf("______________\n", x);
    printf("______________\n", x);
    printf("______________", x);
    return 0;
}

 

[Exercise] Coding (C) - đã hỏi trong Chapter 3: Formatted Input/Output bởi (12.1k điểm)
ID: 26464 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn

đã sửa bởi | 2.9k đã xem

75 Trả lời

0 thích 0 k thích
Hidden content!
#include * ** * ** * * **
int main()
{
** * * * ** ****** ********
-12.123456789
******* * *** *
-12.123457
-12.12346
-12*/
* * * * * ** ** * ** * x = -12.123456789;
**** * ** *** * * * ******* * ** * x);
** ** * * * ** *** *** * * * * * ** * x);
** ***** * * ******* ****** ******** * * %.9lf\n", x);
**** *** * * ** * *** *** ** *** * ******* * **** x);
** *** ***** ** * * * ** *** ** * *** x);
** * **** *** ** * ***** ** * * ** x);
*** ** *** ** * ** * * ** * ** 0;
}
trả lời bởi (82 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include **** ** ** * **
int main()
{
** * ** ***** **** * * x = -12.123456789;

* * * **** * **** ** *** ** * x);
* ** * * ** ** * ** ** * * x);
* ** ** * ** * * * (" * **** *** x);
* * ** * * * ****** * ** *** *** **** x);
*** *** ** * ** * * * ** * x);
** * *** * ** *** *** *** * *** x);
return 0;
}
trả lời bởi (-167 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include * * ** * * *


int main()
{
** *** * *** ** *** x = -12.123456789;
* ** * * * ** * *** * * * * * *** *
* * * **** * *** ***** * ** ****
** * * * * * * ** ***** ** %.9f\n",x);
* * * *** * ** ** * *** * * ** *** *
* * ** * ****** * * ********* * *
** *** * *** ** **** * * **** **** **
 
** ** * ** ** *** * ** 0;
}
trả lời bởi (-233 điểm)
0 0
Case 0: Wrong output
0 thích 0 k thích
Hidden content!
#include <stdio.h>
int main()
{
** ** ** *** * * ** * ** *** x = -12.123456789;
* * * ** ***** ** * **** * **** * * ** x);
* * * * *** ****** * ** ** ** * *** * ** ** x);
* * **** * *** *** * * ** %.9f\n", x);
****** * ** * * * * * ***** * * * * * x);
* *** ** ** ** ** ****** *** * * x);
******** ** ***** **** *** ** ** * * ** * **** x);
** * ** * ** ** *** * 0;
}
trả lời bởi (-32 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include <stdio.h>
int main()
{
**** * ** **** ***** * **** * * x = -12.123456789;
** * ** * * ** ** ** ** ** * ******* *** x);
**** ** ** ** *** **** * * *** *** ** x);
***** ***** ** * * ****** * **** *** * x);
******* ** * * * * *** ********* * * ** x);
** * ******* * * *** ** *** *** * x);
* ** * ** ** **** ** ** * * ** * * * ** *** x);
* ** *** ** ** * * * 0;
}
trả lời bởi (-32 điểm)
0 0
Case 0: Wrong output
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include <stdio.h>
int main()
{
* * * * * * ****** ***** ** x = -12.123456789;
* * * *** *** *** ***** ** ** ** * * **** ** x);
** *** *** *** * * * *** *** * *** *** * *** x);
* *** *** * * * * * %.9f\n", x);
** * ********* * * **** *** * * x);
* * *** ** * ** ** *** **** ***** **** * * * x);
*** ** *** ** ** ** * ** *** * * x);
* * * *** ***** * * ***** 0;
}
trả lời bởi (64 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include <stdio.h>
int main()
{
* * ** * ** x=-12.123456789
* * * * ** ** ** ***** * * * **
* * * * ** * * ** * * *
******* * ** ** ** **** * * * *******
*** * * * * * * * ** ** * * ** ***
* * **** * * *** * *** * *
** * * * * * * ** *** ** ***
** ** * * * 0;
}
trả lời bởi (42 điểm)
0 0
prog.c: In function 'main':
prog.c:5:3: error: expected ',' or ';' before 'printf'
   printf("-12.123\n",x);
   ^~~~~~
prog.c:6:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("-12.123456789\n",x);
          ^~~~~~~~~~~~~~~~~
prog.c:7:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("-12.123456789\n",x);
          ^~~~~~~~~~~~~~~~~
prog.c:8:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("-12.1234567\n",x);
          ^~~~~~~~~~~~~~~
prog.c:9:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("-12.123456\n",x);
          ^~~~~~~~~~~~~~
prog.c:10:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("-12\n",x);
          ^~~~~~~
0 thích 0 k thích
Hidden content!
#include<stdio.h>
int main()
{
** * * * * ** x = -12.123456789;
* * ** ***** **** * * * ** ** * * * x);
*** * * *** * ** ** **** **** ** ** x);
** ** ***** ** * *** %0.9f\n", x);
***** * *** * *** *** **** *** * * x);
*** ** * ** * * *** * ***** ** * *** * * x);
** ** * * * * * * * ** ** ** * *** **** * x);
* * * * * ** * 0;
}
trả lời bởi (-214 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include<stdio.h>
int main()
{

******** * * ** * *** * x = -12.123456789;
** ** * **** ***** *** *** ** * ** * * x);
* ** ****** ** * *** **** * * * ** * x);
*** ** * ** ***** * **** * * * ** ** * * x);
* * * ** **** ** ** * **** **** *** ** x);
** ** * **** * * ***** * ** **** ** * ** * x);
** ****** ** * * ** * *** * * * *** * x);
* * * *** * ** ** * 0;


}
trả lời bởi (-329 điểm)
0 0
Case 0: Correct output
0 thích 0 k thích
Hidden content!
#include <stdio.h>
#include * *********

int main()
{
* * *** * * * *** * x = -12.123456789;
*** * * * ** ** ***** ***** ** ** x);
***** * ** ** * * * *** ** * * ** * * *** * x);
** ** * * * * * * **** * * ** %.9f\n", x);
* * * ** **** * * ** ***** * ** x);
** * ** * *** **** * * ** **** *** * ** x);
** * * ** *** ** * **** *** ** *** x);
** * * *** ** **** * 0;
}
trả lời bởi (-498 điểm)
0 0
Case 0: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.58.63
©2016-2024

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

3 thích 0 k thích
87 trả lời
[Exercise] Coding (C) - đã hỏi ngày 12 tháng 10 năm 2017 trong Chapter 3: Formatted Input/Output bởi thopd (12.1k điểm)
ID: 26463 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 3.2k đã xem
1 thích 0 k thích
0 trả lời
[Resource] đã hỏi ngày 14 tháng 10 năm 2017 trong Chapter 3: Formatted Input/Output bởi thopd (12.1k điểm)
ID: 26948 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 14 đã xem
12,783 câu hỏi
183,443 trả lời
172,219 bình luận
4,824 thành viên