Problem description A real fan, is not required to describe the ^_^ of the topic. Input data group number in first rowT(1≤t≤) 。
Next T line, one formatted string per line, see the sample, the string length does not exceed . Output Real fans, even if I don't give out the format, still can ac this problem.
^_^ Sample input5i am bigzhugod? I am BIGZHUGOD.I am bigzhugod! I AM BIGZHUGOD!!! I AM BIGZHUGOD!!!!! Sample output-_-Orz wow! wooow! wooooow!
The problem is still more water ...
But in the process of AC encountered a few small problems ...
Enter a string method with spaces: string S; Getline (CIN, s) or Char s[100]; Fgets (S, N, stdin);
As if the other method ignores the space and then the character following the space as the next string ...
#include <iostream>#include<string>#include<cstdio>using namespacestd;#defineMAXN 1005intMain () {intT; CIN>>T; T= t+1; while(t--){ strings; Getline (CIN, s); intLen =s.size (); Switch(s[len-1]){ Case '?':p rintf ("-_-\n"); Break; Case '.':p rintf ("orz\n"); Break; Case '!': {printf ("W"); intFlag =0; for(intI=0; i<len; i++){ if(S[i] = ='!') flag++; } for(intj=0; j<flag; J + +) {printf ("o"); } printf ("w!\n"); Break; } } } return 0;}
HDU---Bigzhugod's fans