Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] hivottr = new int[db];
- int[] hivottdb = new int[db];
- for (int i = 0; i < db; i++)
- {
- hivottr[i] = szam[i];
- }
- for (int i = 0; i < db; i++)
- {
- for (int j = 0; j < db; j++)
- {
- if (hivottr[i] == szam[j])
- {
- hivottdb[i]++;
- }
- }
- }
- int hivottmax = 0;
- int maxhivott = 0;
- for (int i = 0; i < db; i++)
- {
- if(hivottdb[i]>hivottmax)
- {
- hivottmax = hivottdb[i];
- maxhivott = hivottr[i];
- }
- }
- Console.WriteLine("7. feladat: Legtöbbször a(z) {0} számot hívta, {1} hívással.", maxhivott, hivottmax);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement