Advertisement
rotti321

Test 11/ 2021

May 31st, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. T11/2021
  2.  
  3. SII
  4. L=[2,4,5,6]
  5. C=[1,6,3,5,6,2,1]
  6.  
  7. for(i=0;i<strlen(s);i++)
  8. if(s[i]!='O' || s[i]!='A' || s[i]!='U') cout<<s[i];
  9. else cout<<'*';
  10.  
  11. for(i=0;i<strlen(s);i++)
  12. if(strchr("UAO",s[i])==NULL) cout<<s[i];
  13. else cout<<'*';
  14.  
  15. SIII ex 1
  16. #include <iostream>
  17.  
  18. using namespace std;
  19.  
  20. void frate(int x, int &y) {
  21. int c, aux, p = 1;
  22. aux = x;
  23. y = 0;
  24. while(aux > 0) {
  25. c = aux % 10;
  26. aux = aux / 10;
  27. if(c == 9) {
  28. y = -1;
  29. return;
  30. }
  31. y = y + (c + 1) * p;
  32. p = p * 10;
  33. }
  34. }
  35.  
  36. int main() {
  37. int x, y;
  38. x = 1234;
  39. frate(x, y);
  40. cout << y;
  41. }
  42.  
  43.  
  44. SIII ex 2
  45. i+j=n
  46. k+j=n
  47. n=k+j
  48. j=n-k
  49.  
  50. #include <iostream>
  51.  
  52. using namespace std;
  53.  
  54. int main() {
  55. int v[21][21],n,k,x;
  56. cin>>n>>k;
  57. for(int i=1;i<=n;i++){
  58. for(int j=1;j<=n;j++){
  59. cin>>v[i][j];
  60. }
  61. }
  62. x=v[k][n-k];
  63. for(int j=n-k-1;j>=1;j--){
  64. v[k][j+1]=v[k][j];
  65. }
  66. v[k][1]=x;
  67.  
  68. for(int i=1;i<=n;i++){
  69. for(int j=1;j<=n;j++){
  70. cout<<v[i][j]<<" ";
  71. }
  72. cout<<endl;
  73. }
  74. }
  75.  
  76. SIII ex 3
  77.  
  78. #include <iostream>
  79.  
  80. using namespace std;
  81.  
  82. int main() {
  83. int x,y,k=1;
  84. cin>>x;
  85. while(cin>>y){
  86. if(y>=x){
  87. k++;
  88. }
  89. }
  90. cout<<k;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement