杭州電子科技大學程式設計競賽(2016’12)- 網路同步賽 1001

來源:互聯網
上載者:User

標籤:row   family   other   nbsp   cout   esc   span   int   ble   

BigZhuGod的粉絲

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 0    Accepted Submission(s): 0

Problem Description真正的粉絲,是不需要題目描述的^_^。Input第一行輸入資料群組數T(1≤T≤100)。
接下來T行,每行一個有格式的字串,詳見範例,字串長度不超過1000。Output真正的粉絲,就算我不給出輸出格式,還是可以AC這道題目。
^_^ Sample Input5 I am BigZhuGod? I am BigZhuGod. I am BigZhuGod! I am BigZhuGod!!! I am BigZhuGod!!!!! Sample Output-_-OrzWow!Wooow!Wooooow!解法:看最後面的符號,然後求!的數目按照樣列輸出
#include<bits/stdc++.h>using namespace std;int main(){    int t;    cin>>t;    while(t--)    {         string s1,s2,s3;         cin>>s1;         cin>>s2;         cin>>s3;         int len=s3.length();         if(s3[len-1]==‘?‘)         {             cout<<"-_-"<<endl;         }         else if(s3[len-1]==‘.‘)         {             cout<<"Orz"<<endl;         }         else         {             int sum=0;             for(int i=0;i<len;i++)             {                 if(s3[i]==‘!‘)                 {                     sum++;                 }             }           //  cout<<sum<<endl;             cout<<"W";             for(int i=1;i<=sum;i++)             {                 cout<<"o";             }             cout<<"w!"<<endl;         }    }    return 0;}

 

杭州電子科技大學程式設計競賽(2016’12)- 網路同步賽 1001

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.