Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ЕСЛИ СПАЛИТЕСЬ ВЫ ЧУШКИ
- ВСЕМ УДАЧИ ЛЮБЛЮ ВАС :3
- Это коды Голодова изменяйте их чтобы не спалиться
- ЗАДАЧА А
- #include <iostream>
- using namespace std;
- int main()
- {
- int N,M,i,j,x,m,q,l,a[20][20],s=0;
- cin>>N>>M;
- for(i=1;i<=N;i++)
- for(j=1;j<=M;j++)
- cin>>a[i][j];
- cin>>x;
- for(m=1;m<=x;m++)
- {
- cin>>q>>l;
- s=s+a[q][l];
- a[q][l]=0;
- }
- cout<<s;
- return 0;
- }
- ЗАДАЧА Б
- #include <iostream>
- using namespace std;
- int main()
- {
- int w, h, y, x;
- cin >> w >> h;
- char f[h][w], s[h][w], l[4];
- for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> f[y][x];
- for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> s[y][x];
- for (y = 0; y < 4; ++y) cin >> l[y];
- for (y = 0; y < h; ++y) {
- for (x = 0; x < w; ++x) cout << l[ (f[y][x]-'0') * 2 + s[y][x]-'0' ];
- cout << endl;
- }
- return 0;
- }
- ЗАДАЧА С
- #include <iostream>
- #include <cmath>
- #include <cstdlib>
- #include <iomanip>
- #include <vector>
- #include <queue>
- #include <cstring>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- int k,f,kn;
- string s;
- while( getline(cin,s) ){
- int i=0;
- while( i<s.length()){
- k=0;
- f=0;
- kn=0;
- while((96<s[i]&&s[i]<123 ||64<s[i]&&s[i]<91) && i<s.length()){
- if(f==0){
- f=1;
- kn=i;
- }
- k++;
- i++;
- }
- int schet=0;
- for(int j=kn;j<kn+k/2;j++){
- char r=s[j];
- schet++;
- s[j]=s[kn+k-schet];
- s[kn+k-schet]=r;
- }
- i++;
- }
- cout<<s<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement