Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, char** argv) {
- int t;/*number of test cases*/
- scanf("%d",&t);char input[10000];
- int num;/*number of input*/
- int n;/*length of string*/
- while(t--){
- scanf("%s",&input);
- if (!strcmp(input,"4")||!strcmp(input,"1")||!strcmp(input,"78")) printf("+\n");
- else{
- n=strlen(input);
- if(input[n-2]=='3'&& input[n-1]=='5') printf("-\n");
- else if (input[0]=='9' && input[n-1]=='4') printf("*\n");
- else if (input[0]=='1' && input[1]=='9' && input[2]=='0') printf("?\n");
- }
- }
- return (EXIT_SUCCESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement