pat_1
2-0
2-1
#include <stdio.h> int main()
{
int inch,foot,cm;
scanf("%d",&cm);
foot=cm/30.48;
inch=cm*/30.48-foot*;
printf("%d %d\n",foot,inch);
return ;
}
2-2
#include <stdio.h>
int main()
{
int h,min,time;
int tmp;
scanf("%d%d",&tmp,&time);
h=tmp/;
min=tmp%;
min+=time%;
if(min>=)
{
h+=min/;
min=min%;
}
if(min<)
{
h-=;
min+=;
}
h+=time/;
printf("%d%02d\n",h,min); return ;
}
2-3
#include <stdio.h>
int main()
{
int tmp;
int a,b,c;
scanf("%d",&tmp);
c=tmp%;
b=tmp/%;
a=tmp/;
if(c!=)
{
printf("%d%d%d",c,b,a);return ;
}
if(b!=)
{
printf("%d%d",b,a);return ;
}
printf("%d\n",a);
return ;
}
3-0
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a<=)
{
printf("Speed: %d - OK\n",a);
}
else{
printf("Speed: %d - Speeding\n",a);
}
return ;
}
3-1
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
int tmp=a%;
if((tmp==)||(tmp==)||(tmp==))
{
printf("Fishing in day %d\n",a);
}
else{
printf("Drying in day %d\n",a);
}
return ;
}
3-2
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b)
{
printf("%c\n",'C');
}
if(a==c)
{
printf("%c\n",'B');
}
if(c==b)
{
printf("%c\n",'A');
}
return ;
}
用天平找小球
4-0
#include <stdio.h>
int main()
{
int a;
int i,j,k;
int count=;
scanf("%d",&a);
for(i=a;i<a+;i++)
{
for(j=a;j<a+;j++)
{
for(k=a;k<a+;k++)
{
if(i!=j && i!=k &&j!=k)
{
printf("%d%d%d",i,j,k);
count++;
if(count%==)
{
printf("\n");
}
else
{
printf(" ");
}
}
}
}
}
return ;
}
求符合给定条件的整数集
4-2
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
for(int i=;i<=a;i++)
{
for(int j=;j<=a;j++)
{
if(j<=i)
{
printf("%d*%d=%-4d",j,i,i*j);
}
if(j==i)
{
printf("\n");
}
}
}
return ;
}
打印九九口诀表
pat_1的更多相关文章
- POJ3717 Decrypt the Dragon Scroll
Description Those who have see the film of "Kong Fu Panda" must be impressive when Po open ...
随机推荐
- AnyWhere
anyexec_date 201506171258 anyexec_date @@AnyWhereCmd idc python /home/appadmin/nicker/tools/QUI.py m ...
- IOS通过PushSharp开源框架发送推送
1,首先生成推送证书: openssl x509 -in aps_developer_identity.cer -inform DER -out aps_developer_identity.pem ...
- 使导出excle文档实现ALT+Enter的效果()
JAVA中输入什么转义字符,使导出excle文档实现ALT+Enter的效果?或者有没有其他方法可以实现. 20 JAVA中输入什么转义字符,使导出excle文档实现ALT+Enter的效果?或者有没 ...
- nginx+mysql+php
根据生产环境安装操作系统(centos 6.0 64位系统),安装完成后,使用Xshell通过ssh协议连接服务器.ssh 用户名@IP+回车+输入密码后登录系统.#mkdir -p /home/to ...
- BZOJ 2741 【FOTILE模拟赛】L(可持久化trie)
http://www.lydsy.com/JudgeOnline/problem.php?id=2741 思路:我们先将a变成a的异或前缀,这样问题就变成了,在l-1到r区间内,找出i,j令a[i]^ ...
- live555 源代码简单分析1:主程序
live555是使用十分广泛的开源流媒体服务器,之前也看过其他人写的live555的学习笔记,在这里自己简单总结下. live555源代码有以下几个明显的特点: 1.头文件是.hh后缀的,但没觉得和. ...
- java.lang.UnsatisfiedLinkError: no XXX in java.library.path
其中涉及的测试源码如下: For those who didn't install Javawith default settings, a systematic way for solving JN ...
- 【转】100行代码实现最简单的基于FFMPEG+SDL的视频播放器
FFMPEG工程浩大,可以参考的书籍又不是很多,因此很多刚学习FFMPEG的人常常感觉到无从下手.我刚接触FFMPEG的时候也感觉不知从何学起. 因此我把自己做项目过程中实现的一个非常简单的视频播放器 ...
- hdu 5625 Clarke and chemistry
Problem Description Clarke is a patient with multiple personality disorder. One day, Clarke turned i ...
- 表格td标签在不添加多余标签的情况下实现文本内容单行显示,多余部分省略号表示的方法
#table { table-layout: fixed; } .content { white-space: nowrap; text-overflow: ellipsis; -o-text-ove ...