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的更多相关文章

  1. POJ3717 Decrypt the Dragon Scroll

    Description Those who have see the film of "Kong Fu Panda" must be impressive when Po open ...

随机推荐

  1. 实习小白笔记一(鼠标悬停、获取多选、提交修改、layer页面、单元格文字长度、json、分页、左连接)

    ①easyui 当鼠标悬停显示单元格信息: $(this).datagrid('doCellTip',{'max-width':'600px','delay':300}); ②jquery 获取che ...

  2. 使用SQL脚本访问操作远程数据库

    USE [Hik] GO /****** Object: StoredProcedure [dbo].[sp_test] Script Date: 08/21/2015 09:55:21 ****** ...

  3. JS的全局变量&局部变量

    <script> var i=10; //全局变量 j = 20; //全局变量 function(){ var i=30; //局部变量 h = 40; //全局变量 } </sc ...

  4. [C++程序设计]基于对象的程序设计 基于对象的程序设计

    1. 面向对象分析(object oriented analysis,OOA)2. 面向对象设计(object oriented design,OOD)3. 面向对象编程(object oriente ...

  5. python笔记之subprocess模块

    python笔记之subprocess模块 [TOC] 从Python 2.4开始,Python引入subprocess模块来管理子进程,以取代一些旧模块的方法:如 os.system.os.spaw ...

  6. New Start!

    博客连续搬了几个地方,从一开始的网易lofter,到点点,再到后来新浪sae自己搭建,折腾了很久,都因为各种原因没有坚持写博. 想了想,其实说到底还是因为懒,根本原因是自己没有毅力.什么不能贴代码,不 ...

  7. centos 6.5 安装 nginx+php+mysql

    一.准备工作 (1)配置防火墙 1.首先检查iptables服务的状态 [root@woxplife ~]# service iptables status iptables: Firewall is ...

  8. 定时任务:Java中Timer和TimerTask的使用

    java.util.Timer定时器,实际上是个线程,定时调度所拥有的TimerTasks. 一个TimerTask实际上就是一个拥有run方法的类,需要定时执行的代码放到run方法体内,TimerT ...

  9. css案例学习之span边框实现的特殊效果

    bottom left bottom right top left top right 配合颜色来使用,实现一些神奇的效果 #menu a span{ height:; width:; /*borde ...

  10. cf479A Expression

    A. Expression time limit per test 1 second memory limit per test 256 megabytes input standard input ...