#include<stdio.h>
#include<string.h>
int main()
{
int T,i,j,k,max;
while(scanf("%d",&T)&&T!=0)
{
max=0;
struct Color
{
char s[200];
int n;
}color[2000];
for(i=0;i<T;i++)
scanf("%s",color[i].s);
for(i=0,color[i].n=0;i<T;i++)//每种颜色的个数color[i].n
{
for(j=0;j<T;j++)
{
if(strcmp(color[i].s,color[j].s)==0)
color[i].n+=1;
}
}
/*for(i=0;i<T;i++)//输出每种颜色出现的个数
printf("%d ",color[i].n);
printf("\n");
*/
for(i=0;i<T;i++)//颜色出现次数最多的数组名赋给k
{
if(color[i].n>max)
{
max=color[i].n;
k=i;
}
}
printf("%s\n",color[k].s);
for(i=0;i<T;i++)//颜色的个数归零
color[i].n=0;
}
//while(1);
return 0;
}
相关推荐
Spring Boot 3.5.4 + LangChain4j实战:用Milvus搭建企业级RAG问答系统(附阿里百炼API配置)
本文详细介绍了如何利用Spring Boot 3.5.4、LangChain4j与Milvus构建企业级RAG问答系统。内容涵盖从架构设计、阿里百炼API安全配置、Milvus部署优化,到RAG检索、会话管理等核心实现,并提供了生产级API设计、监控集成及性能优化等实战经验,旨在帮助开发者打造高可用、可维护的Java AI应用。
HDOJ1004 Let the Balloon Rise
HDOJ1004 题目 Input Input contains multiple test cases. Each test case starts with a number N (0 < N <= 1000) – the total number of balloons distributed. The next N lines contain one color each. T...
手把手教你排查Abaqus中的Johnson-Cook损伤参数:避免因d3正负号导致的仿真失败
本文详细解析了Abaqus中Johnson-Cook损伤参数d3正负号设置的关键问题,帮助用户避免因参数错误导致的仿真失败和Excessive distortion报错。通过对比不同文献定义、提供实操指南和典型错误排查流程,有效提升非线性分析的准确性和效率。
杭电oj HDOJ 1004 Let the Balloon Rise
杭电oj HDOJ 1004 Let the Balloon Rise 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 guessing the most ...
转录组PCA分析3大常见误区:数据标准化、离群样本与批次效应处理
本文深入探讨转录组PCA分析中的三大常见误区:数据标准化、离群样本识别与批次效应处理。通过实战案例和R代码演示,揭示如何优化PCA结果以提升生物学解释力,特别关注数据标准化策略的选择和批次校正方法的应用,帮助研究者避免常见陷阱并获得可靠的转录组分析结果。
Unity类银河战士恶魔城学习总结(P162 Improve skeleton提升敌人的效果)
为敌人添加了快慢刀
HDOJ P1004 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): 50537 Accepted Submission(s): 18110 Problem Description Con
卫朋:IPD流程落地——产品计划阶段拆解
IPD计划阶段拆解
HDOJ 1004 Let the Balloon Rise 超详细
HDOJ 1004 Let the Balloon Rise 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 guessing the most popular problem. When the contest is over, they will count
RAG系统中Embedding模型选型实战
本文详细介绍了RAG系统中Embedding模型选型实战,希望能对学习RAG的同学们有所帮助。 文章目录 1. 前言 2. 思路解析 3. 测评数据集构建 3.1 步骤一 3.2 步骤二 3.3 数据示例 3.4 总结 4. 实战代码 4.1 本地模型 4.2 使用第三方的Embedding模型API
UG NX二次开发(C++)-NX2406系列二次开发编程模板配置
前面已经写了有关UG NX二次开发编程模板配置的文章,但是由于NX2406/2412系列的版本中,在UGOpen文件夹中没有了vs_files文件夹了,而是采用了VSIX Project的方式配置(其适用于VS2019),在VS2022中不能正确的配置。我结合以前配置模板的经验和现在的配置方式讲一下NX2406系列二次开发编程模板的配置。我把相应的编程模板放在资源文件UG NX二次开发编程模板(基于NX2406版本制作)中,方便大家下载使用。
HDOJ 1004 Let the Balloon Rise
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1004 import java.io.*; import java.util.*; public class Main{ public static void main(String[] args){ Scanner cin = new Scanner(System.in); whi...
大模型之Spring AI实战系列(一):基础认知篇 - 开启智能应用开发之旅
Spring AI 是一个轻量级开源框架,旨在简化 AI 模型在企业级 Java 应用中的集成与管理。它提供了跨多个 AI 服务提供商的便携式 API,支持聊天、文本转图像、嵌入式模型等多种功能,并兼容主流的 AI 模型提供商如 OpenAI、Google 等。Spring AI 的核心功能包括结构化输出、向量数据库支持、工具/函数调用、可观察性、文档摄取 ETL 框架、AI 模型评估等。
HDOJ--1004Let the Balloon Rise
原题链接 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 guessing the most popular problem. Wh
WINCC7.3破解文件
WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!
IEM模型,地表粗糙度模拟
利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟
HDOJ 1004 Let the Balloon Rise 解题报告
今天早上起来写1004, 看了题目知道是统计字符串的, 没有什么难度,, 意味写一遍就可以AC了。结果写出来怎么都AC不了。。。 后来上完课回来,想了想,, 才发现是flag没有清零,, 又犯了这种低级错误。。 Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 6553...
Data-Structures-and-Algorithm-Analysis-in-Java.pdf
作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...
HDOJ1004:Let the Balloon Rise
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 guessing the most popular problem. When the contest
Statistics and Machine Learning Toolbox
Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具
HDOJ杭电1004 Let the Balloon Rise
看了网上的几篇答案,用的都是排序然后整理出答案。题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=1004 以下是我的思路:首先自然是把输入存进一个二维字符串数组。当然,数组中不会有相同的字符串。然后设一个整型数组,下标与字符串数组相对应,整型数组的内容是每一个字符串的个数。这样就算是整理好数据了。 #include #include int mai
【HDOJ】【1004】Let the Balloon Rise
非常简单的一道题,在GCC下调试。 方法比较笨,3次通过,记录一下。 直接上代码 #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ typedef struct Node { in
hdoj 1004 Let the Balloon Rise 解题报告
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 guessing the most popular problem. When the contest is
HDOJ_1004_Let the Balloon Rise
HDOJ_1004_Let the Balloon Rise
HDOJ 1004 Let the Balloon Rise(C语言)
其实是很简单的一道题 我的思路是用二维数组存储字符串,随后用strcmp函数确定字符串是否相等,若相等则指针++,同时比较是否大于前一个字符串的出现次数,如果大于,覆写次数和index,最后输出下标为index的字符串,接着清空二维数组。 #include <stdio.h> #include <string.h> int main(void){ char map[10001][20]; int max = 0; int index = 0; int temp = 0; i
HDOJ1004 Let the Balloon Rise
Let the Balloon Rise Problem Description Input Output Sample Input Sample Output Source Code 方法一 方法二 Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65...
HDOJ 1004 Let the Balloon Rise 让气球升起来
根据输入的颜色(实际就是一个一个的token),统计出颜色最多的那个。实际是记录哪个字符串出现的次数最多。使用HashMap记录各个串对应的次数就好,最终输出次数最多的串。 package string; import java.util.HashMap; import java.util.Scanner; /** * Created by yangyuan on 2017/12/12
[HDOJ] problem_1004 【Let the Balloon Rise】
[HDOJ] problem_1004 Let the Balloon Rise:
HDOJ--1004(Let the Balloon Rise)
问题: http://acm.hdu.edu.cn/showproblem.php?pid=1004 题解: 水题,解题的关键在于如何记录下出现的气球的颜色及其出现的次数(数据结构的选取),显然,这里可以使用Map。 具体思路见代码:
HDOJ-1004 Let the Balloon Rise
二维字符数组
620



被折叠的 条评论
为什么被折叠?



