Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Threading;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int vvodinint;
- int otvet = 0;
- int kolvo = 0;
- string data = DateTime.Now.ToString();
- int answer;
- int ves;
- ves = 0;
- StreamWriter sw = new StreamWriter(Path.GetTempPath() + "calories.txt", true);
- Console.Write("Введите вес: ");
- ves = Console.Read();
- Thread.Sleep(1);
- Console.Write("Введите кол-во значений: ");
- kolvo = Console.Read();
- Console.Write("Введите значение: ");
- vvodinint = Console.Read();
- sw.WriteLine(data);
- sw.Flush();
- sw.WriteLine("Мой вес: " + ves);
- sw.Flush();
- while (kolvo != 0 || kolvo > 0)
- {
- sw.WriteLine(vvodinint);
- sw.Flush();
- otvet = otvet + vvodinint;
- kolvo = kolvo - 1;
- Console.Write("Введите значение: ");
- vvodinint = Console.Read();
- }
- sw.WriteLine(otvet);
- sw.Flush();
- sw.Close();
- answer = 0;
- Console.WriteLine("Хотите посмотреть результаты? 1 если да 0 если нет");
- answer = Console.Read();
- if (answer == 1)
- {
- File.Open(Path.GetTempPath() + "calories.txt", FileMode.Open);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement