Advertisement
Vranimir

Balanced numbers

Feb 17th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. class Program
  6. {
  7. static void Main()
  8. {
  9.  
  10.  
  11. for (int i = 0; i <= 10000; i++)
  12. {
  13. int input = int.Parse(Console.ReadLine());
  14.  
  15. int a = input % 10;
  16. int aOne = input / 10;
  17. int b = aOne % 10;
  18. int c = aOne / 10;
  19. int sum = 0;
  20.  
  21. bool ballanced = ((a + c) == b);
  22.  
  23. if (ballanced)
  24. {
  25. while (ballanced)
  26. { sum += input; break; }
  27. }
  28. else { break; }
  29.  
  30. }
  31.  
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement