下列 程序读入时间将其假1秒后输出,格式为hh:mm:ss,当小时等于24小时置为0#include struct { int hour ,minute,second; } time ;void main(void){ scanf("%d:%d:%d",[input=type:blank,size:4][/input] ); time.second++; if( [input=type:blank,size:4][/input]==60) { [input=type:blank,size:4][/input] time.second=0; if( time.minute==60) { time.hour++; time.minute=0; if([input=type:blank,size:4][/input]) time.hour=0; } }
举一反三
- 下列程序读入时间数值,将其加1秒后输出,时间格式为:hh:m:ss,即小时:分钟:秒,当小时等于24小时,置为0。#include<stdio.h>[br][/br]struct{[br][/br]int hour,minute,second;}time;[br][/br]int main(void){scanf("%d:%d:%d",[input=type:blank,size:4][/input])[br][/br]time.second++;[br][/br]if([input=type:blank,size:4][/input]==60){[br][/br][input=type:blank,size:4][/input];time.second =0;[br][/br]if(time.minute==60){[br][/br]time.hour++;[br][/br]time.minute =0;[br][/br]if([input=type:blank,size:4][/input])time.hour =0;}}printf("d:%d:%d \n",time.hour,time.minute,time.second )[br][/br]return 0;}[br][/br]
- 下列程序读入时间数值,将其加1秒后输出,时间格式为:hh: mm: ss,即“小时:分钟:秒”,当小时等于24小时,置为0。 #include <stdio.h> struct { int hour, minute, second; } time; int main(void) { scanf("%d:%d:%d",___________); time.second++; if(___(2)_______ == 60) { ____(3)__________ ; time.second = 0; if(time.minute == 60) { time.hour++; time.minute = 0; if(_____(4)_________) time.hour = 0; } } printf ("%d:%d:%d ", time.hour, time.minute, time.second ); return 0; }
- 输入2个整数,输出它们的最小公倍数和最大公约数#include <stdio.h>void main(){ int m, n,gbs,gys; scanf([input=type:blank,size:4][/input]); for(gbs=m;[input=type:blank,size:4][/input]; gbs=gbs+m); gys=[input=type:blank,size:4][/input] [input=type:blank,size:4][/input] }
- [input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]合称为五脏;[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]合称为六腑;[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、合称为奇恒之腑。
- 结缔组织可分为:[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]、[input=type:blank,size:4][/input]和[input=type:blank,size:4][/input]。