(1) test1.c (¤p¼g)
-------------------------
#include <stdio.h>
#include <stdlib.h>
#include "console.c"
main(){
int age;
SetScrnSize(40,10);
setrgb(2); // ºñ
printf("Q: enter age: ");
scanf("%i", &age);
setrgb(1); // ¬õ
printf("A: age = %i \n", age);
setrgb(0); // ¥Õ
system("pause");
}
|
(2) test2.cpp
-------------------------
#include <iostream>
main(){
int age;
printf("Q: enter age: ");
scanf("%d", &age);
printf("A: age = %d \n", age);
}
(3) test3.cpp
-------------------------
#include <iostream>
using namespace std;
main(){
int age;
cin >> age;
cout << "age = " << age << endl;
}
|