博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
BNUOJ27873:A Special "Happy Birthday" Song!!!
阅读量:6374 次
发布时间:2019-06-23

本文共 1920 字,大约阅读时间需要 6 分钟。

There are n people (excluding myself) in my 30th birthday party. They sing the traditional "happy birthday" song:

Happy birthday to you! Happy birthday to you! Happy birthday to Rujia! Happy birthday to you!!!

Since I love music, I want to hear something more interesting, not that everyone sings together. Ah yes, I want one person to sing one word!

For example, there are three people: Mom, Dad, Girlfriend, I'd like them to sing like this:

Mom: HappyDad: birthdayGirlfriend: toMom: youDad: HappyGirlfriend: birthdayMom: toDad: youGirlfriend: HappyMom: birthdayDad: toGirlfriend: RujiaMom: HappyDad: birthdayGirlfriend: toMom: you

Very nice, right? What if there are more than 16 people? That's easy: repeat the song until everyone has sung at least once :)

Please, don't stop in the middle of the song.

Input

There is only one test case. The first line contains a single integer n (1<=n<=100). Then each of the next n lines contains a capitalized name (i.e. one upper-case letter followed by zero or more lower-case letters). Each name contains at most 100 characters and do not have whitespace characters inside.

Output

Output the song, formatted as above.

Sample Input

3MomDadGirlfriend

Output for the Sample Input

Mom: HappyDad: birthdayGirlfriend: toMom: youDad: HappyGirlfriend: birthdayMom: toDad: youGirlfriend: HappyMom: birthdayDad: toGirlfriend: RujiaMom: HappyDad: birthdayGirlfriend: toMom: you

Rujia Liu's Present 6: Happy 30th Birthday to Myself

Special Thanks: All of you, for participating in this contest; Mom and Dad, for giving birth to me :)

 

题意很简单,就是N个人,没人唱一次歌词,如果人数多于16,则重复

 

#include 
#include
#include
using namespace std;char name[105][105];char song[16][16] = {"Happy","birthday","to","you","Happy","birthday","to","you","Happy","birthday","to","Rujia","Happy","birthday","to","you"};int main(){ int n,i,j,k; while(~scanf("%d",&n)) { for(i = 0; i

 

 

转载地址:http://bwnqa.baihongyu.com/

你可能感兴趣的文章
友元函数和友元类
查看>>
SpringMVC中CRUD实例
查看>>
java-jmx使用
查看>>
Win8Metro(C#)数字图像处理--2.15图像霓虹效果
查看>>
Expo大作战(十七)--expo结合哨兵(sentry)进行错误异常记录
查看>>
vue.js入门学习
查看>>
第8件事 3步打造产品的独特气质
查看>>
debug-stripped.ap_' specified for property 'resourceFile' does not exist
查看>>
利用MapReduce计算平均数
查看>>
Git review :error: unpack failed: error Missing tree
查看>>
在Sql Server中使用Guid类型的列及设置Guid类型的默认值
查看>>
《Kubernetes与云原生应用》系列之容器设计模式
查看>>
scala-05-map映射
查看>>
Spring Boot - how to configure port
查看>>
右键添加复制路径选项
查看>>
DocFetcher 本机文件搜索工具
查看>>
ambassador 学习三 限速处理
查看>>
linux日志服务器审计客户端history记录
查看>>
HTTP传输编码增加了传输量,只为解决这一个问题 | 实用 HTTP
查看>>
SQL2000数据库修改sa密码
查看>>