CppQt:在屏幕上显示HelloWorld;
#include <QApplication>
#include <QLabel>
int main(int argc, argv[]){
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
#include <QApplication>
#include <QLabel>
int main(int argc, argv[]){
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
#include <stdio.h>
int main(){
int hour1,minute1;
int hour2, minute2;
scanf("%d %d",&hour1,&minute1);
scanf("%d %d",&hour2,&minute2);
int t1=hour1*60+minute1;
int t2=hour2*60+minute2;
int t=t2-t1;
printf("The time different is %d %d",t/60,t/60);
return 0;
}
#include <stdio.h>
int main(){
int mynum=10;
int yournum;
scanf("%d",&yournum);
if(mynum==yournum)
printf("Result True");
if(yournum<mynum)
printf("Sorry Smaller");
else
printf("Sorry Bigger");
return 0;
}
#include <stdio.h>
int main(){
float a, b;
scanf("%f%f",&a,&b);
printf("%f%f",b,a);
return 0;
}
#include <stdio.h>
int a, b=0;
for(a=1;a<=100;a++)
if(a%2==0)
b=b+a;
printf("%d",b);
return 0;
}