Advertisement
K_Y_M_bl_C

Проходик

May 22nd, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.76 KB | None | 0 0
  1. ЕСЛИ СПАЛИТЕСЬ ВЫ ЧУШКИ
  2. ВСЕМ УДАЧИ ЛЮБЛЮ ВАС :3
  3. Это коды Голодова изменяйте их чтобы не спалиться
  4.  
  5. ЗАДАЧА А
  6. #include <iostream>
  7. using namespace std;
  8. int main()
  9. {
  10.     int N,M,i,j,x,m,q,l,a[20][20],s=0;
  11.     cin>>N>>M;
  12.    
  13.     for(i=1;i<=N;i++)
  14.     for(j=1;j<=M;j++)
  15.     cin>>a[i][j];
  16.    
  17.     cin>>x;
  18.    
  19.     for(m=1;m<=x;m++)
  20.     {
  21.         cin>>q>>l;
  22.         s=s+a[q][l];
  23.         a[q][l]=0;
  24.     }
  25.    
  26.     cout<<s;
  27.     return 0;
  28. }
  29.  
  30. ЗАДАЧА Б
  31. #include <iostream>
  32. using namespace std;
  33.  
  34. int main()
  35. {
  36.     int w, h, y, x;
  37.     cin >> w >> h;
  38.     char f[h][w], s[h][w], l[4];
  39.     for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> f[y][x];
  40.     for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> s[y][x];
  41.     for (y = 0; y < 4; ++y) cin >> l[y];
  42.     for (y = 0; y < h; ++y) {
  43.         for (x = 0; x < w; ++x) cout << l[ (f[y][x]-'0') * 2 + s[y][x]-'0' ];
  44.         cout << endl;
  45.     }
  46.     return 0;
  47. }
  48.  
  49. ЗАДАЧА С
  50. #include <iostream>
  51. #include <cmath>
  52. #include <cstdlib>
  53. #include <iomanip>
  54. #include <vector>
  55. #include <queue>
  56. #include <cstring>
  57. #include <string>
  58. #include <fstream>
  59.  
  60. using namespace std;
  61.  
  62. int main()
  63. {
  64.   int k,f,kn;
  65.   string s;
  66.   while( getline(cin,s) ){
  67.     int i=0;
  68.     while( i<s.length()){
  69.          k=0;
  70.          f=0;
  71.          kn=0;
  72.         while((96<s[i]&&s[i]<123 ||64<s[i]&&s[i]<91) && i<s.length()){
  73.             if(f==0){
  74.                 f=1;
  75.                 kn=i;
  76.             }
  77.             k++;
  78.             i++;
  79.         }
  80.         int schet=0;
  81.         for(int j=kn;j<kn+k/2;j++){
  82.             char r=s[j];
  83.             schet++;
  84.             s[j]=s[kn+k-schet];
  85.             s[kn+k-schet]=r;
  86.  
  87.         }
  88.         i++;
  89.     }
  90.  
  91.     cout<<s<<endl;
  92.  }
  93.   return 0;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement