Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7507 - Массивын их нь хэд дэх |
Өгөгдсөн нэг хэмжээст бүхэл тоон массивын хамгийн их элемент хэд дэх нь вэ? Хэрэв хамгийн их элемент 1-ээс их бол бага дугаарыг нь хэвлэнэ.
Input
Эхний мөрөнд массивын элементийн тоо өгөгдөнө. n<=100.
Хоёр дахь мөрөнд массивын элементүүд зайгаар тусгаарлагдан өгөгдөнө.
Output
Массивын хамгийн их элемент, дугаарын хамт зайгаар тусгаарлагдан нэг мөрөнд хэвлэгдэнэ.
Example
Input: 5
9 10 8 10 6 Output: 10 2
Нэмсэн: | Bataa |
Огноо: | 2013-01-15 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE |
hide comments
|
|||||||||||
2022-08-28 15:53:18
bi misheel zaya hoyriin alind sn um be al llr psda gcy |
|||||||||||
2022-05-11 10:35:07
Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you We've known each other for so long Your heart's been aching, but you're too shy to say it (say it) Inside, we both know what's been going on (going on) We know the game and we're gonna play it And if you ask me how I'm feeling Don't tell me you're too blind to see Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you |
|||||||||||
2022-05-11 10:34:56
Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you We've known each other for so long Your heart's been aching, but you're too shy to say it (say it) Inside, we both know what's been going on (going on) We know the game and we're gonna play it And if you ask me how I'm feeling Don't tell me you're too blind to see Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you |
|||||||||||
2022-04-04 10:49:28
#include<stdio.h> int main(){ int a,n,s,max,k; scanf("%d",&n); int havana[100]; for(int i=0; i<n; i++){ scanf("%d",&havana[i]); } max=havana[0]; for(int i=1; i<n; i++){ if(havana[i]>max){ max=havana[i]; s=i; } } printf("%d %d",max,s+1); } |
|||||||||||
2022-04-02 11:03:00
zvg ajilj bhd nofsh ve #include<iostream> using namespace std; main() { int a[100],n,s,i,max; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n;i++) max = a[1]; for(i=2;i<=n;i++) if(a[i]>max) max = a[i]; for(i=1;i<=n;i++) if(a[i]==max) { s+=1; } cout<<max<<" "<<s; } |
|||||||||||
2022-03-30 08:28:04
#include<stdio.h> main(){ int c,b,n,i,s=1,a[100]; scanf("%d",&n); for(i=0 ; i<n ; i++) scanf("%d",&a[i]); for(i=1 ; i<=n ; i++){ if(a[0]<a[i]){ s+=1; a[0]=a[i]; } } printf("%d %d",a[0],s); } |
|||||||||||
2022-03-30 08:06:58
I don't know why I run away |
|||||||||||
2022-03-29 05:39:07
#include<bits/stdc++.h> int main(){ int n,i,a[1000],t=0,q; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",a[i]); } for(i=1;i<=n;i++){ if(a[i]>t) t=a[i]; q=i; } printf("%d %d",t,q); } huul suguudaa |
|||||||||||
2022-01-20 15:51:38
#include<stdio.h> #include<math.h> int n[100],a,b,c=0,d,m ,e; int main() { scanf("%d",&a); for(b=1; b<=a; b++) scanf("%d",&n[b]); m=n[1]; for(b=2; b<=a; b++) { if(n[b]>m) m=n[b]; } for(b=1; b<=m; b++) { if(m==n[b]) break; e=b; } printf("%d %d",m,e+1); return 0; } hairtai shv nomio hahahah |
|||||||||||
2021-11-01 03:02:41
orgil iveeld mash ih hairtai |