Let the Balloon Rise
注意每次進入迴圈後將p陣列清零初始化!!!要不真的是無限WA QAQ
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
int n,max,i,j,l,p[1000];
char m[1000][20];
while(scanf("%d",&n)!=EOF)
{
if(n==0)break;
memset(p,0,sizeof(p));
for(i=0;i<n;i++)
{
scanf("%s",& m[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(strcmp(m[i],m[j])==0)
p[i]++;
}
}
max=0,l=0;
for(i=0;i<n;i++)
{
if(p[i]>=max)
{
max=p[i];
l=i;
}
}
printf("%s\n",m[l]);
}
return 0;
}
相關推薦
HDUOJ Let the Balloon Rise 1004
mit cit strcmp ever con inpu iss multipl you ?? /* Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/3
hdu_1004 Let the Balloon Rise
iter int ++ tro gin cin urn () its #include<bits/stdc++.h> using namespace std; int n,vmax; string x,smax; map<string,int> m;
hduoj 1004 Let the Balloon Rise [鏈表解法]
balloons uri () nat out ces rmi 鏈接 HERE 原題鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Problem Description Contest time again! How
HDU 1004 Let the Balloon Rise
second div pre code namespace stream http return first 1 #include<iostream> 2 #include<cstdio> 3 #include<map> 4
HDU(1004)Let the Balloon Rise
esc 方式 pin oat num 賦值 strcmp inpu tell Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/
HDOJ 1004 Let the Balloon Rise (字串+stl)
題目: Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite tim
HDU 1004 Let the Balloon Rise (STL map)
HDU 1004 Let the Balloon Rise 題解 #include<iostream> #include<algorithm> #include<string> #include<math.h> #includ
【ACM】HDU 1004 Let the Balloon Rise (for java)
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated metho
HDU1004 Let the Balloon Rise 解題報告
目錄 題目資訊 Problem Description Input Output Sample Input Sample Output 思路 原始碼 題目資訊 Problem Description Contest time ag
【HUD】1004 : Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s
杭電oj 1004------Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s):
ACM/HDU1006 Let the Balloon Rise,讓氣球上升
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guess
Let the Balloon Rise 2周練4
Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is
hdu 1004 (Let the balloon rise) c、c++
hdu 1004(Let the balloon rise) 題目:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Problem Description Contest time again! How exci
Let the Balloon Rise
注意每次進入迴圈後將p陣列清零初始化!!!要不真的是無限WA QAQ #include<stdio.h> #include<string.h> #include<math.h> int main() { int n
HDU 1004 ( Let the Balloon Rise )
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total
hdu 1004 Let the Balloon Rise map的應用
圖片 cli span style end iterator con n) b- 題目鏈接http://acm.hdu.edu.cn/showproblem.php?pid=1004 map的用法,第一次看見map還能這麽用 #include<ios
HDOJ_1004_Let the Balloon Rise
pan ext guarantee eof define tee decide ESS fclose Font Size: ← → Problem Description Contest time again! How excited it is to see ballo
let the bollom rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 107103 Accepted Submi
【2018沈陽現場賽k】Let the Flames Begin
style 適用於 shu bsp 乘法 add pac class 復雜度 題意 有n個人圍成一圈,編號1到n,從1號開始報數,每報到第k個,此人出列,下一個人再從1開始報數,求第m個出列的人的編號(n,m,k ≤ 1e18, m,k其中一個小於1e6) 分析