Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _2b.MissCat201_notArray
- {
- class MissCat201_notArray
- {
- static void Main(string[] args)
- {
- uint n = uint.Parse(Console.ReadLine());
- int cat1 = 0;
- int cat2 = 0;
- int cat3 = 0;
- int cat4 = 0;
- int cat5 = 0;
- int cat6 = 0;
- int cat7 = 0;
- int cat8 = 0;
- int cat9 = 0;
- int cat10 = 0;
- byte choice;
- for (int i = 0; i < n; i++)
- {
- choice = byte.Parse(Console.ReadLine());
- switch (choice)
- {
- case 1: cat1++; break;
- case 2: cat2++; break;
- case 3: cat3++; break;
- case 4: cat4++; break;
- case 5: cat5++; break;
- case 6: cat6++; break;
- case 7: cat7++; break;
- case 8: cat8++; break;
- case 9: cat9++; break;
- case 10: cat10++; break;
- }
- }
- byte missCat = 1;
- int maxVote = cat1;
- if (cat2 > maxVote)
- {
- maxVote = cat2;
- missCat = 2;
- }
- if (cat3 > maxVote)
- {
- maxVote = cat3;
- missCat = 3;
- }
- if (cat4 > maxVote)
- {
- maxVote = cat4;
- missCat = 4;
- }
- if (cat5 > maxVote)
- {
- maxVote = cat5;
- missCat = 5;
- }
- if (cat6 > maxVote)
- {
- maxVote = cat6;
- missCat = 6;
- }
- if (cat7 > maxVote)
- {
- maxVote = cat7;
- missCat = 7;
- }
- if (cat8 > maxVote)
- {
- maxVote = cat8;
- missCat = 8;
- }
- if (cat9 > maxVote)
- {
- maxVote = cat9;
- missCat = 9;
- }
- if (cat10 > maxVote)
- {
- maxVote = cat10;
- missCat = 10;
- }
- Console.WriteLine(missCat);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement