Advertisement
Guest User

Dodowanie

a guest
Jan 29th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string[] suma = new string[1001];
  14. Console.WriteLine("Pedkic");
  15. int szetczik = 0;
  16. int x = Int32.Parse(Console.ReadLine());
  17.  
  18. for (int i = 0; i < x; i++)
  19. {
  20. Console.WriteLine("Priv");
  21. string[] z1 = new string[1000];
  22.  
  23. for(int l1 = 0; l1 < z1.Length; l1++)
  24. {
  25. z1[l1] = Console.ReadLine();
  26. }
  27. Console.WriteLine("Pierwsza liczba : " + z1);
  28.  
  29. string[] z2 = new string[1000];
  30. for (int l2 = 0; l2 < z2.Length; l2++)
  31. {
  32. z2[l2] = Console.ReadLine();
  33. }
  34. Console.WriteLine("Pierwsza liczba : " + z2);
  35.  
  36. int koniec;
  37. for(koniec = 0; z1[koniec] != null && z2[koniec] != null; koniec++)
  38. {
  39. }
  40.  
  41. for(int j = koniec; z1[j] != null && z2[j] != null; j--)
  42. {
  43. int k1 = Int32.Parse(z1[j]);
  44. int k2 = Int32.Parse(z2[j]);
  45. int k0 = k1 + k2 + szetczik;
  46. szetczik = 0;
  47.  
  48. if(k0 >= 10)
  49. {
  50. int l = k0 - 10;
  51. suma[koniec + 1] = Convert.ToString(l);
  52. szetczik++;
  53. }
  54. }
  55. Console.WriteLine("Suma: " + suma);
  56. }
  57.  
  58.  
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement