#include <iostream> #include <string.h> using namespace std; int main(){ char s[1000]; gets(s); int len = strlen(s); for(int j=0;j<len;j++){ if(s[j]=='W') printf("Wednesday\n"); else if(s[j]=='S'&&s[j+1]=='a'){ printf("Saturday\n"); j++; } else if(s[j]=='S'&&s[j+1]=='u'){ printf("Sunday\n"); j++; } else if(s[j]=='Y') break; else printf("Wrong data\n"); } return 0; } |
Double click to view unformatted code.