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. user密码

    一.修改密码 alter user hr identified by hr; password/passw hr: SYS@test>password hr Changing password ...

  2. php对数组中指定键值排序

    function array_sort($arr,$keys,$type='asc'){ $keysvalue = $new_array = array(); foreach ($arr as $k= ...

  3. [Head First Python]2. python of comment

    1- 多行注释 ''' ''' 或 """ """ '''this is the standard way to include a mul ...

  4. Contains Duplicate 解答

    Question Given an array of integers, find if the array contains any duplicates. Your function should ...

  5. 关于memcpy和memmove的一点说明

    今天看到书上降到memcpy和memmove的区别才突然发现原来两者之间有如此区别,以前只知道这两个函数是 实现同样的功能,没有接触到其不同. memcpy和memmove在MSDN的定义如下: 从两 ...

  6. java提高篇(二二)-----LinkedList

    摘自http://blog.csdn.net/chenssy/article/details/18099417  java提高篇(二二)-----LinkedList 一.概述 LinkedList与 ...

  7. 微信iOS WKWebview 网页开发适配指南

    微信iOS客户端将于2017年3月1日前逐步升级为WKWebview内核,需要网页开发者提前做好网站的兼容检查和适配. 背景 WKWebView 是苹果在iOS 8中引入的新组件,目的是提供一个现代的 ...

  8. 了解SQL注入攻击

    SQL注入:利用现有应用程序,将(恶意)的SQL命令注入到后台数据库引擎执行的能力,这是SQL注入的标准释义. 随着B/S模式被广泛的应用,用这种模式编写应用程序的程序员也越来越多,但由于开发人员的水 ...

  9. FileUpload的使用案例

    文件上传 1.www.apache.org下载commons fileupload 和 commons io 2.创建jsp并附上如下代码 <%@ page language="jav ...

  10. jquery工具

    http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxsplitter/jquery-splitter-gett ...