F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_29381446_25623.cpp: In function 'int main()':
0_0_29381446_25623.cpp:2:146: error: expected '}' at end of input
  int main(void){    int n, m, val, i;     while(scanf("%d%d", &n, &m) != EOF) {        if(n == 0 && m == 0)            break;         if(n == 0) {            // n=0时,只需要输出m            printf("%d\n", m);        } else {            // 读入n个数据,同时输出数据,并且在适当位置输出m            int flag = 1;            for(i=0; i<n; i++) {                scanf("%d", &val);                 if(flag && val >= m) {                    if(i == 0)                        printf("%d", m);                    else                        printf(" %d", m);                    flag = 0;                }                 if(i>0 || !flag)                    printf(" ");                printf("%d", val);            }            if(flag)                printf(" %d", m);            printf("\n");        }    }     return 0;}
                                                                                                                                                  ^
0_0_29381446_25623.cpp:2:146: error: expected '}' at end of input
0_0_29381446_25623.cpp:2:146: error: expected '}' at end of input


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-15 10:37:07, Gzip enabled