| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 557 人关注过本帖
标题:all right,here is a c problem
取消只看楼主 加入收藏
设计大师的路
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2012-12-1
结帖率:76.92%
收藏
 问题点数:0 回复次数:0 
all right,here is a c problem
#include<stdio.h>
int main()
{
int a,b,c,d;
while(scanf("%d:%d",&a,&b)!=EOF)
 {
 if(a<=12&&b<60)  
 c=a;  
printf("%d:%d\n",c,b);  
if(a>12&&a<=24&&b<60)   
c=a-12;      
printf("%d:%dPM\n",c,b);   
if(b>=60)   
printf("输入时间不合理.\n");  
}
return 0;
}

while input a number , change into a 24 hour form.
搜索更多相关主题的帖子: problem 
2012-12-07 00:01
快速回复:all right,here is a c problem
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013878 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved