Advertisement
rotti321

T12/2021 BAC

Jun 4th, 2021
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1.  
  2.  
  3. 1c 2a 3d 4b 5c
  4. II 1 a 2 2 4 4 9
  5.  
  6. 2b 19,23
  7.  
  8. III 1.
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. void frate(int x, int& y)
  14. {
  15.     int c, p = 1;
  16.     y = 0;
  17.     while( x != 0 ){
  18.         c = x%10;
  19.         if( c == 9 ){
  20.             y = -1;
  21.             return;
  22.         }
  23.         y = (c+1) * p + y;
  24.         p *= 10;
  25.         x /= 10;
  26.     }
  27. }
  28.  
  29. int main()
  30. {
  31.     int x, y;
  32.     cin >> x;
  33.     frate(x, y);
  34.     cout << y;
  35. }
  36.  
  37.  
  38. for(i=0;i<strlen(s);i++)
  39. if(strchr("OAU",s[i])!=NULL) cout<<"*";
  40. else cout<<s[i];
  41.  
  42. III 2.
  43. x=a[k][n-k];
  44. for(j=n-k-1;j>=1;j--){
  45.     a[k][j+1]=a[k][j];
  46. }
  47. a[k][1]=x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement