A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© brenthe 中级黑马   /  2016-5-17 22:40  /  1079 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

/#include <stdio.h>
//int main (){
//    int secPut,day,hour,minute,secOut;
//    printf("请输入秒数:");
//    scanf("%d",&secPut);
//    day = secPut/(60*60*24);
//    secOut = secPut%(60*60*24);
//    hour = secOut/3600;
//    secOut=secOut%3600;
//    minute=secOut/60;
//   
////    secOut=secOut%60;
//    法二: day= secPut/(60*60*24);
//          hour=secPut%(60*60*24)/3600;
//          minute=secPut%3600/60;
//          secOut=secPut%60;
//   
//    printf("是第%d天,第%d小时,第%d分钟,第%d秒\n",day,hour,minute,secOut);
//   
//}
//#include <stdio.h>
//int main ()
//{
//    int year, res;
//    printf("请输入年份:");
//    scanf("%d",&year);
//    res = (year % 400 == 0 ) || ((year % 4 == 0)&&(year%100!=0));
//    printf("%d\n",res);
//    if(res==1) printf("此年是闰年\n");
//    else printf("此年非闰年\n");
//    return 0;
//}
//#include <stdio.h>
//int main ()
//{
//    double a;
//    printf("请输入一个小数:");
//    scanf("%lf",&a);
//    int b=a*10.0;
//    int c=b%10;//将原数放大10倍,然后对10求余数,算出第一位小数上的值
//    int d=a;//对原数强制类型转换,取其整数部分,法2 int d=a+0.5
//    if(c>=5)
//        d+=1;
        法2 int d=a+0.5

//    printf("%d\n",d);

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马