arrow_forward همه ارسال‌ها

جزئیات ارسال کد#500

code_blocks
مسئله مربوطه: نمرات تیام (#24) arrow_outward
verified
وضعیت داوری نهایی: پاسخ نادرست تست 1
terminal
زبان برنامه‌نویسی: C++
schedule
ارسال‌کننده و زمان:
shana (۲ سال پیش)
descriptionsolution.cpp ۳۰ خط • ۴۴۴ بایت
1#include <iostream>
2using namespace std;
3int main()
4{
5 int n , x , counter;
6 cin >> n;
7 counter = 0;
8
9 for ( int i = 0 ; i < n ; i ++ )
10 {
11 cin >> x;
12 if ( x != 0 )
13 {
14 cout << x <<" ";
15 }
16
17 else if ( x == 0 )
18 {
19 counter ++;
20 }
21 }
22
23 for ( int i = 0 ; i < counter ; i ++ )
24 {
25 cout <<'0';
26 }
27
28
29 return 0;
30}
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8