Advertisement
cubeBullet

Untitled

Sep 25th, 2022
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | Source Code | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp3
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.           var n = int.Parse(Console.ReadLine());
  10.           int sbV = 1;
  11.           int A=0, B=0, C=0, SBV=1;
  12.           for(int i =1; i<=n; i++)
  13.           {
  14.             var a = int.Parse(Console.ReadLine());
  15.             var b = int.Parse(Console.ReadLine());
  16.             var c = int.Parse(Console.ReadLine());
  17.             int x = (a / b);
  18.             for( int j = 1; j<=c; j++) sbV*=x;
  19.             if(sbV>=SBV)
  20.             {
  21.               A=a;
  22.               B=b;
  23.               C=c;
  24.               SBV=sbV;
  25.             }
  26.             sbV=1;
  27.           }
  28.           Console.WriteLine($"{A} : {B} = {SBV} ({C})");
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement