Advertisement
mizutanisixty

情弱発見器

Oct 24th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <string>
  4. #define 情弱 "ゆうたりゃん"
  5. using namespace std;
  6. void main(){
  7. string m;
  8. size_t p;
  9. char t[256];
  10. bool f = false;
  11. cout << "検索対象を入力(,区切り)\t> ";
  12. cin >> m;
  13. while((p=m.find(","))!=string::npos){
  14.     strcpy(t, m.c_str());
  15.     t[p] = '\0';
  16.     if(!strcmp(t, 情弱)){
  17.         cout << "発見 : "<< t << "は情弱です\n";
  18.         f = true;
  19.     }
  20.     m = t + p + 1;
  21. }
  22. if(!f)
  23.     printf("該当なし");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement