
试题 历届真题 时间显示【第十二届】【省赛】【B组】
注意事项有
类型占用存储空间表数范围
byte1字节-2^7 ~ 2^7-1(-128~127)
short2字节-2^15 ~ 2^15-1(-32768~32767)
int4字节-2^31 ~ 2^31-1 (-2147483648~2147483647) 约21亿
long4字节-2^31 ~ 2^31-1
long long8字节-2^63 ~ 2^63-1
c++ 输出前补0,
头文件:
函数:setw(int n)
函数:setfill(char c)(不调用该函数时默认用空格进行占位)
cout< 输出:00000123
#include
#include
using namespace std;
int main()
{
long long time;
cin>>time;
time=time/1000;
int seconds=0;
int minute=0;
int hours=0;
seconds=time%60;
time=time/60;
minute=time%60;
time=time/60;
hours=time%24;
cout<
评论列表(0条)