- #include<bits/stdc++.h>
- #include<string.h>
- #include<string>
- using namespace std;
- int main()
- {
- char str[100000],r[100000],cas[100000];
- while(gets(str)){
- int j=0;
- if(strcmp(str,"DONE")==0) break;
- for(int i=0;i<strlen(str);i++){
- if(isalpha(str[i])) r[j++]= str[i];
- }
- for(int i=0;i<j;i++) {
- if(r[i]>='a' && r[i]<='z') r[i]=r[i]-32;
- }
- for(int i=0;i<j;i++)
- {
- cas[j-1-i]=r[i];
- }
- int c=0;
- for(int i=0;i<j;i++){
- if(cas[i]==r[i]) c++;
- }
- if(c==j) cout<<"You won't be eaten!\n";
- else cout<<"Uh oh..\n";
- }
- return 0;
- }
Sunday, 18 November 2018
uva problem 10945 Mother bear solution
Subscribe to:
Post Comments (Atom)
variable declaration of c program
#include <stdbool.h> #include<bits/stdc++.h> #include <stdio.h> #include <string.h> #include <std...
-
#include<bits/stdc++.h> #include<cmath> #include<algorithm> #define mx 20000005 using namespace std ; ...
-
#include<stdio.h> #include<string.h> int main ( void ) { char y [ 100001 ] ; int m4,m100,m400,m15...
-
#include<bits/stdc++.h> using namespace std ; int main ( ) { int arr [ 10005 ] ; int n,m,mi,d ; ...
No comments:
Post a Comment