Регистрация
28 Апр 2013
Сообщения
78
Репутация
0
Спасибо
0
Монет
0
#include <iostream>

using namespace std;

int max(int a, int b) {

return a > b? a : b;

}

int main() {

int a, b;

cin >> a >> b;

cout << max(a, b) << '\n';

system("pause > nul");

}
 
static int max(int one,int two)
{
if (one == two) return one;
else if (one > two) return one;
else if (one < two) return two;
else return 0;
}



int i = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(max(i,b));
Console.ReadLine();
 
using System;
namespace New_Project
{ class Program
{ public static int max(int a, int b)
{ return a > b ? a : b; }
public static void Main()
{ int a, b; Console.Write("a b: ");
var line = Console.ReadLine().Split();
a = int.Parse(line[0]);
b = int.Parse(line[1]);
Console.WriteLine(max(a, b)); } } }
 
Назад
Сверху