Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include<iostream>
- using namespace std;
- int main()
- {
- int arr[4][3]={
- {8,'?',21},
- {35,'?',12},
- {32,'?',31},
- {4,'?',28}
- };
- int l,sum=0;
- for(int i=0;i < 4;i++)
- {
- for(int j=0;j < 3;j++)
- {
- if(j>0)
- {
- l=arr[i][0];
- if(j==2 && arr[i][j-1]==(int)'?')
- {
- int val=arr[i][j];
- while(val!=0)
- {
- sum=sum+val%10;
- val/=10;
- }
- arr[i][j-1]=l-sum; // m
- cout<<arr[i][j-2]<<"\t"<<arr[i][j-1]<<"\t"<<arr[i][j]<<endl;
- sum=0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement