Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- T11/2021
- SII
- L=[2,4,5,6]
- C=[1,6,3,5,6,2,1]
- for(i=0;i<strlen(s);i++)
- if(s[i]!='O' || s[i]!='A' || s[i]!='U') cout<<s[i];
- else cout<<'*';
- for(i=0;i<strlen(s);i++)
- if(strchr("UAO",s[i])==NULL) cout<<s[i];
- else cout<<'*';
- SIII ex 1
- #include <iostream>
- using namespace std;
- void frate(int x, int &y) {
- int c, aux, p = 1;
- aux = x;
- y = 0;
- while(aux > 0) {
- c = aux % 10;
- aux = aux / 10;
- if(c == 9) {
- y = -1;
- return;
- }
- y = y + (c + 1) * p;
- p = p * 10;
- }
- }
- int main() {
- int x, y;
- x = 1234;
- frate(x, y);
- cout << y;
- }
- SIII ex 2
- i+j=n
- k+j=n
- n=k+j
- j=n-k
- #include <iostream>
- using namespace std;
- int main() {
- int v[21][21],n,k,x;
- cin>>n>>k;
- for(int i=1;i<=n;i++){
- for(int j=1;j<=n;j++){
- cin>>v[i][j];
- }
- }
- x=v[k][n-k];
- for(int j=n-k-1;j>=1;j--){
- v[k][j+1]=v[k][j];
- }
- v[k][1]=x;
- for(int i=1;i<=n;i++){
- for(int j=1;j<=n;j++){
- cout<<v[i][j]<<" ";
- }
- cout<<endl;
- }
- }
- SIII ex 3
- #include <iostream>
- using namespace std;
- int main() {
- int x,y,k=1;
- cin>>x;
- while(cin>>y){
- if(y>=x){
- k++;
- }
- }
- cout<<k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement