http://codeforces.com/gym/100548

A 签到

问一个序列是不是yes,yes的序列满足每个数都是3的倍数。

 

 1 #include<cstdio>
 2 int main(){
 3     int t,n,x;
 4     while(~scanf("%d",&t)){
 5         int cas=1;
 6         while(t--){
 7             scanf("%d",&n);
 8             bool flag=true;
 9             while(n--){
10                 scanf("%d",&x);
11                 if(x%3) flag=false;
12             }
13             printf("Case #%d: ",cas++);
14             puts(flag?"Yes":"No");
15         }
16     }
17     return 0;
18 }
View Code

相关文章:

  • 2021-08-31
  • 2022-01-25
  • 2021-10-29
  • 2022-12-23
  • 2021-11-09
  • 2021-07-21
猜你喜欢
  • 2022-03-03
  • 2022-01-04
  • 2021-09-11
  • 2021-08-01
  • 2022-12-23
  • 2021-12-25
  • 2022-01-14
相关资源
相似解决方案