#include<stdio.h>
void main()
{
int a,b,c,d;
scanf("%d:%d:%d",&a,&b,&c);
if(a>12)
{
d=a-12;
printf("%d:%d:%d%s\n",d,b,c"AM");
}
else
printf("%d:%d:%d%s\n",a,b,c"PM");
}
这个程序是将24小时变成12小时的 可是错误是
D:\demo2\demo2.cpp(9) : error C2143: syntax error : missing ')' before 'string'
D:\demo2\demo2.cpp(9) : error C2059: syntax error : ')'
D:\demo2\demo2.cpp(13) : error C2143: syntax error : missing ')' before 'string'
D:\demo2\demo2.cpp(13) : error C2059: syntax error : ')'
Error executing cl.exe.
有谁懂得啊·····