Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 15th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include<cstdio>
  2.  
  3. using namespace std;
  4.  
  5. int tcc;
  6. int n,m;
  7. int main(){
  8.         int i,j,k;
  9.         scanf("%d",&tcc);
  10.         for(i=0;i<tcc;i++){
  11.                 scanf("%d:%d",&n,&m);
  12.                 if (m!=0){
  13.                         printf("0\n");
  14.                         continue;
  15.                 }
  16.                 if (n<=12){
  17.                         printf("%d\n",n+12);
  18.                 }else{
  19.                         printf("%d\n",n-12);
  20.                 }
  21.         }
  22.         return 0;
  23. }