Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <istream>
  5. #include <fstream>
  6. #include <string>
  7. #include <algorithm>
  8. #include <vector>
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <string.h>
  12. using namespace std;
  13.  
  14. int main() {
  15.    string a;
  16.     char b[100000];
  17.     cin >> a;
  18.     int m=a.length();
  19.      strcpy(b, a.c_str());
  20.      int n;
  21. cin >> n ;
  22. int skaicius;
  23. char raide;
  24. for(int i=0; i<n ; i++)
  25. {
  26.     cin >> skaicius >> raide;
  27.     b[skaicius-1]=raide;
  28. }
  29. string ats="";
  30.      for(int i=0; i<m; i++)
  31.      {
  32.          ats+= b[i];
  33.      }
  34.      if(ats=="desmond")
  35.         cout << "I love you, Desmond!" << endl << n << endl;
  36.      else cout << "Goodbye, my love!" << endl;
  37.    return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement