Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main (){
- int arr_size = 3;
- int nums[arr_size];
- for(int i = 0; i < arr_size; i++){
- do{
- cout << i << " :";
- cin >> nums[i];
- }while (nums[i]<99 || nums[i]>1000);
- }
- for(int i = 0; i < arr_size; i++){
- int curr, ed, des, stot;
- curr = nums[i];
- ed = curr % 10;
- curr /= 10;
- des = curr % 10;
- curr /= 10;
- stot = curr % 10;
- if (ed + stot == des)
- {
- cout << nums[i] << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement