Problem Name : Paula's Mathematic Game
Solution :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Author : Md .shohanur Rahaman | |
/// UriOj Problem No : 1192 | |
/// Problem Name : Paula's Mathematic Game | |
/// Problem Type : AdHoc | |
#include<stdio.h> | |
#include<ctype.h> | |
int main() | |
{ | |
char c; | |
int i,test,a,b; | |
while(scanf("%d",&test)==1){ | |
for(i=1;i<=test;i++){ | |
scanf("%d %c %d",&a,&c,&b); | |
if(a>=0 && a<=9 && b>=0 && b<=9){ | |
if(a==b) | |
printf("%d\n",a*b); | |
else if(islower(c)) | |
printf("%d\n",a+b); | |
else if(isupper(c)) | |
printf("%d\n",b-a); | |
} | |
} | |
} | |
return 0; | |
} |