Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int a[2020];
- int b[2021];
- a[0] = 5;
- a[1]= 2;
- a[2]= 5;
- a[3]= 0;
- b[0]=3;
- b[1]=2;
- b[2]=8;
- b[3]=1;
- /*for(int i = 0; i <3; i++){
- a[i] = i+1;
- b[i] = 3-i;
- }
- for(int i = 0; i <3; i++){
- cout<< a[i];
- }
- cout<<"\n";
- for(int i = 0; i <3; i++){
- cout<< b[i];
- }*/
- cout<<"\n";
- if(a[3] == 0 || b[3]==1){
- for (int i =2; i>=0 ; i--){
- a[i]=a[i]-b[i];
- if(a[i]<0){
- a[i] = a[i]+10;
- a[i-1] = a[i-1]-1;
- }
- }
- }
- for(int i = 0; i<3;i++){
- cout<<a[i]<<" ";
- }
- }
Add Comment
Please, Sign In to add comment