[ create a new paste ] login | about

Link: http://codepad.org/7qykFOBb    [ raw code | output | fork ]

C, pasted on Dec 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>
int main()
{
    int n,i,max;
    scanf("%d",&n);
    int a[100];
    max=a[0];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
		
        if(a[i]>max) a[i]=max;
    }
    printf("%d",max);
    return 0;
}


Output:
1
-144059468


Create a new paste based on this one


Comments: