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 ...
随机推荐
- UVA11806Cheerleaders(容斥)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud 题目意思:在m行n列的矩形网格中放k个相同的石子,问有多少中方法?每个格子最多放一 ...
- (原)caffe在ubuntu中设置GPU的ID号及使用多个GPU
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5884892.html 参考网址: http://caffe.berkeleyvision.org/tu ...
- HDU 1556 Color the ball - from lanshui_Yang
Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a ...
- Java中的IO学习总结
今天刚刚看完java的io流操作,把主要的脉络看了一遍,不能保证以后使用时都能得心应手,但是最起码用到时知道有这么一个功能可以实现,下面对学习进行一下简单的总结: IO流主要用于硬盘.内存.键盘等处理 ...
- Android中对手机文件进行读写
参考张泽华视频 (一)读写手机内存卡中的文件 对手机中的文件进行读写操作,或者新增一个文件时,可直接使用openFileOutput / openFileInput 得到文件的输出.输入流. Fi ...
- 基于cygwin构建u-boot(二)gcc的C语言标准版本号(-std=)
接上文,修改Makefile和config.mk中,.depend相关文件格式后继续编译. 四.tools文件夹的文件编译错误 错误告警如下[多行信息,请使用右侧滚动条查看]: gcc -Wall - ...
- POJ 1190 生日蛋糕(DFS)
生日蛋糕 Time Limit: 1000MSMemory Limit: 10000KB64bit IO Format: %I64d & %I64u Submit Status Descrip ...
- 像asp.net Mvc一样开发nodejs+express Mvc站点
像asp.net Mvc一样开发nodejs+express Mvc站点 首先,我是个c#码农.从事Mvc开发已然4个年头了,这两年前端MVC的兴起,我也跟风学了一些,对前端的框架也了解一些,angu ...
- SQL Server 2008空间数据应用系列七:基于Bing Maps(Silverlight) 的空间数据展现
原文:SQL Server 2008空间数据应用系列七:基于Bing Maps(Silverlight) 的空间数据展现 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Microsoft ...
- cf479D Long Jumps
D. Long Jumps time limit per test 1 second memory limit per test 256 megabytes input standard input ...