Advertisement
Guest User

Untitled

a guest
Dec 25th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. /// Author : Md .shohanur Rahaman
  2. /// UriOj Problem No : 1192
  3. /// Problem Name : Paula's Mathematic Game
  4. /// Problem Type : AdHoc
  5.  
  6. #include<stdio.h>
  7. #include<ctype.h>
  8. int main()
  9. {
  10. char c;
  11. int i,test,a,b;
  12. while(scanf("%d",&test)==1){
  13. for(i=1;i<=test;i++){
  14. scanf("%d %c %d",&a,&c,&b);
  15. if(a>=0 && a<=9 && b>=0 && b<=9){
  16. if(a==b)
  17. printf("%d\n",a*b);
  18. else if(islower(c))
  19. printf("%d\n",a+b);
  20. else if(isupper(c))
  21. printf("%d\n",b-a);
  22. }
  23. }
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement