1 条题解
-
0
C :
#include <stdio.h> int main() { int i,max; int buf[10]; for(i=0;i<=9;i++) scanf("%d\n",&buf[i]); max=buf[0]; for (i=1;i<10;i++) { if(buf[i]>max) max=buf[i]; } printf("%d\n",max); }
C++ :
#include<iostream> using namespace std; int main() { int a,max=-0xffff; while(cin >> a){ if(a > max) max = a; } cout << max << endl; return 0; }
Pascal :
var i,max:longint;a:array[1..10000]of longint; begin for i:=1 to 10 do readln(a[i]); max:=a[1];for i:=1 to 10 do if max<a[i] then max:=a[i]; writeln(max); end.
Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int a[]=new int[10]; for(int i=0;i<10;i++){ a[i]=s.nextInt(); } int max=a[0]; for(int i=0;i<10;i++){ if(a[i]>max) max=a[i]; } System.out.println(max); } }
Python :
import sys print max(int(x) for x in sys.stdin.readlines())
C# :
using System; namespace C言语 { class _2_6 { public static void Main() { int[] a = new int[10]; int max = -2100000000; foreach (int i in a) { a[i] = int.Parse(Console.ReadLine()); if (max < a[i]) max = a[i]; } Console.WriteLine(max); Console.ReadLine(); return; } } }
- 1
信息
- ID
- 1223
- 时间
- 1000ms
- 内存
- 32MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者