1037. 在霍格沃茨找零钱(20)
来源:互联网 发布:阿里云企业邮箱设置 编辑:程序博客网 时间:2024/06/05 00:53
#include<stdio.h>int main(){ long Gallon1=0,Gallon2=0,Gallon3,temp=0; int Sickle1=0,Sickle2=0,Knut1=0,Knut2=0,Sickle3,Knut3,flag1=0,flag2=0,flag3=0,temp1,temp2; scanf("%ld.%d.%d",&Gallon1,&Sickle1,&Knut1); scanf("%ld.%d.%d",&Gallon2,&Sickle2,&Knut2); if((Gallon2*29*17+Sickle2*29+Knut2)<(Gallon1*29*17+Sickle1*29+Knut1)) { flag3 = 1; temp = Gallon2; Gallon2 = Gallon1; Gallon1 = temp; temp1 = Sickle2; Sickle2 = Sickle1; Sickle1 = temp1; temp2 = Knut2; Knut2 = Knut1; Knut1 = temp2; } Knut3 = Knut2 - Knut1; if(Knut3<0) { flag1 = 1; Knut3 += 29; } if(flag1) Sickle2--; Sickle3 = Sickle2 - Sickle1; if(Sickle3<0) { flag2 = 1; Sickle3 += 17; } if(flag2) Gallon2--; Gallon3 = Gallon2 - Gallon1; if(flag3) printf("-"); printf("%ld.%d.%d",Gallon3,Sickle3,Knut3); return 0;}
0 0
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 【PAT】1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- 1037. 在霍格沃茨找零钱(20)
- python笔记
- 1036. 跟奥巴马一起编程(15)
- Effective Java-学习笔记(10-11章)
- ThinkPHP5.0-请求
- apk签名信息查看
- 1037. 在霍格沃茨找零钱(20)
- 12号c总结
- windows7下安装centos7系统或者单独装centos7
- MySql的一些内置函数
- Java基础——方法的重载和重写的区别与分析
- 1038. 统计同成绩学生(20)
- 文章标题
- python中datetime操作
- 欢迎使用CSDN-markdown编辑器