Guest User

Untitled

a guest
Feb 19th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.         }
  13.         static void task01()
  14.         {
  15.             int countA = 0, countB = 0, countC = 0, getMark, excellentGrade;
  16.             for (int x = 1; x <= 100; x++)
  17.             {
  18.                 Console.WriteLine("Enter number");
  19.                 getMark = int.Parse(Console.ReadLine());
  20.                 if (getMark < 55)
  21.                     countA++;
  22.                 else if (getMark > 56 && getMark < 70)
  23.                     countB++;
  24.                 else if (getMark > 69 && getMark < 91)
  25.                     countC++;
  26.             }
  27.             excellentGrade = 100 - (countA + countB + countC);
  28.             Console.WriteLine("55: {0}\n56-69: {1}\n70-90: {2}\n90+: {3}", countA, countB, countC, excellentGrade);
  29.         }
  30.         static void task02()
  31.         {
  32.             int total = 0, getEarn, highest = 0;
  33.             for (int x = 1; x <= 10; x++)
  34.             {
  35.                 Console.WriteLine("enter money");
  36.                 getEarn = int.Parse(Console.ReadLine());
  37.                 total += getEarn;
  38.                 if (getEarn > highest)
  39.                     highest = getEarn;
  40.             }
  41.             Console.WriteLine("Total: {0}\nHighest: {1}", total, highest);
  42.         }
  43.         static void task03()
  44.         {
  45.             int dropIDWinner = 0, dropIDLosser = 0, lengthDrop, high = 0, low = 0;
  46.             double avarageDrops = 0;
  47.             for (int x = 1; x <= 17; x++)
  48.             {
  49.                 Console.WriteLine("enter length` drop");
  50.                 lengthDrop = int.Parse(Console.ReadLine());
  51.                 avarageDrops += lengthDrop;
  52.                 if (high == 0 && low == 0)
  53.                 {
  54.                     high = lengthDrop;
  55.                     low = lengthDrop;
  56.                     dropIDWinner = x;
  57.                     dropIDLosser = x;
  58.                 }
  59.                 if(lengthDrop > high)
  60.                 {
  61.                     high = lengthDrop;
  62.                     dropIDWinner = x;
  63.                 }
  64.                 else if(lengthDrop < low)
  65.                 {
  66.                     low = lengthDrop;
  67.                     dropIDLosser = x;
  68.                 }
  69.             }
  70.             Console.WriteLine("Winner: ID - {0}, Length - {1}\nLoser: ID - {2}, Length - {3}\nAvarage Drops: {4}", dropIDWinner, high, dropIDLosser, low, (avarageDrops / 17));
  71.         }
  72.         static void task04()
  73.         {
  74.             int count = 0, getNum;
  75.             for (int x = 1; x <= 100; x++)
  76.             {
  77.                 Console.WriteLine("enter number");
  78.                 getNum = int.Parse(Console.ReadLine());
  79.                 if ((x * x) == getNum)
  80.                     count++;
  81.             }
  82.             Console.WriteLine("Total: ", count);
  83.         }
  84.     }
  85. }
Add Comment
Please, Sign In to add comment