djelad1

Untitled

Nov 28th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int arr[ROWS][COLS];
  2. int i = 0, j = 0, sum1 = 0, sum2 = 0;
  3. cout << "plese enter 6 numbers : ";
  4. for (i = 0; i < ROWS; i++)
  5. {
  6. for (j = 0; j < COLS; j++)
  7. {
  8. cin >> arr[i][j];
  9. }
  10. }
  11.  
  12. for (j = 0,i=0; j < COLS; j++)
  13. {
  14. while (arr[i][j] > 0)
  15. {
  16. sum1 += arr[i][j] % 10;
  17. arr[i][j] /= 10;
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment