3066:【例13.1】空格分隔输出
[例 13.1] 空格分隔输出
1026:空格分隔输出
https://www.bilibili.com/video/BV1vs4y1v7v3/
#include <bits/stdc++.h>
using namespace std;
int main()
{
char a;int b;float c;double d;
cin>>a>>b>>c>>d;
cout<<a<<" "<<b;
printf(" %.6f %.6f",c,d);
return 0;
}
3067:【例13.2】 电子表
[例 13.2] 电子表
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long time,x,y,z;
cin>>time;
x=time/3600;
y=time%3600/60;
z=time%3600%60;
printf("%.02d:%.02d:%.02d",x,y,z);
return 0;
}
3068:【例13.3】时间差
[例 13.3] 时间差
#include <bits/stdc++.h>
using namespace std;
int main()
{
char d;
int a,b,c,ans;
cin>>a>>d>>b>>d>>c;
ans=a*3600+b*60+c;
ans*=-1;
cin>>a>>d>>b>>d>>c;
ans=ans+a*3600+b*60+c;
cout<<ans;
return 0;
}
3069:练13.1竖式计算
练 13.1 竖式计算
竖式计算(c++基础)
codeup27980 乘法算式(NOIP1996普及组第1题)
codeup27980 乘法算式(NOIP1996普及组第1题)_从键盘读入2个100以内的正整数,进行乘法运算并以竖式输出。-CSDN博客
#include<iostream>
using namespace std;
int main(){
cout<<" 18"<<endl<<"+ 870"<<endl<<"-----------"<<endl<<" 888";
return 0;
}
3070:练13.2 对齐输出
练 13.2 对齐输出
1003:对齐输出
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,c;
cin>>a>>b>>c;
printf("%8d %8d %8d",a,b,c);
return 0;
}