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 ...
随机推荐
- zoj Grouping(强连通+缩点+关键路径)
题意: 给你N个人,M条年龄大小的关系,现在打算把这些人分成不同的集合,使得每个集合的任意两个人之间的年龄是不可比的.问你最小的集合数是多少? 分析: 首先,假设有一个环,那么这个环中的任意两个点之间 ...
- 【solr专题之二】配置文件:solr.xml solrConfig.xml schema.xml
1.关于默认搜索域 If you are using the Lucene query parser, queries that don't specify a field name will use ...
- web.xml中配置Spring中applicationContext.xml的方式
2011-11-08 16:29 web.xml中配置Spring中applicationContext.xml的方式 使用web.xml方式加载Spring时,获取Spring applicatio ...
- 深入学习微框架Spring-boot
深入学习微框架:Spring Boot 深入学习微框架:Spring Boot
- 【Git】代码托管-从基本设置开始
Git是现在比较火的一款代码托管工具,之前也有在使用GitHub,是用GitHub for windows一个图形管理的界面,如果没有这个图形控制界面的话我估计自己又要放弃了.用BASH命令来实现托管 ...
- Effective Java单元测试JUnit - 就是爱Java
实作了RoleImpl class,现在要开始单元测试了,或许你会觉得奇怪,才刚做好一个class而已,它并没有商业规则,只有getter/setter与clone(),那是要测试什么呢?没错,传统上 ...
- USB-CSW之旅
前面总结了usb mass storage的枚举过程,如果所有枚举正常,那么会进入bulkonly协议定义的数据交流,在这个数据包里面还包含了SCSI的协议. Bulkonly协议usbmassbul ...
- ***.M51文件详细注释
;说明:这是1950编译后生成的Keil_1910.M51文件,以此为例来讲解M51文件 // :: PAGE BL51 BANKED LINKER/LOCATER V6., INVOKED BY: ...
- Mybatis的连接池
先总结一个原则:mytatis的连接池最大值poolMaximumActiveConnections尽量跟服务器的并发访问量持平以至于大于并发访问量. 原因:在org.apache.ibatis.da ...
- 一个C#多线程的工作队列
多线程添加元素到队列中,队列根据绑定 的事件进行自动处理,可以设置WorkSequential属性来实现对队列处理的单线程(严格顺序处理)或者多线程处理(循序出队,但是 多线程处理,不保证对队列元素的 ...