Advertisement
Guest User

Untitled

a guest
Nov 16th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 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. using System.IO;
  7.  
  8. namespace euler13
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int osszeg = 0;
  15.             string sor;
  16.             int elso = 0;
  17.             StreamReader szam = new StreamReader("szam.txt");
  18.             string[] szamok= new string[100];
  19.             for (int i = 0; i < 100; i++)
  20.             {
  21.                 szamok[i]=(szam.ReadLine());
  22.             }
  23.             for (int j = 0; j < 50; j++)
  24.             {
  25.                
  26.                 for (int i = 0; i < 100; i++)
  27.                 {
  28.                     sor=szamok[i];
  29.                     elso = Convert.ToInt32(sor[j]);
  30.                     Console.WriteLine(elso);
  31.                     Console.WriteLine(sor[j]);
  32.                     Console.WriteLine(Convert.ToInt32(sor[j]));
  33.                     osszeg += elso;
  34.                     Console.WriteLine(osszeg);
  35.                 }
  36.                 osszeg = 0;
  37.             }
  38.             Console.ReadLine();
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement