本文共 495 字,大约阅读时间需要 1 分钟。
标签:水题
/* 题意:排名初值为1500,经过N次变化,判断变化后的值是否等于R*/#includeint main(){ int T; scanf("%d", &T); while(T--) { int N, R; int change; int initial = 1500; scanf("%d %d", &N, &R); for(int i = 0; i < N; i++) { scanf("%d", &change); initial += change; } if(initial == R && initial > 0) printf("Correct\n"); //initial > 0, 排名不能为负数 else printf("Bug\n"); } return 0;}
转载地址:http://ankxi.baihongyu.com/