Your browser does not support JavaScript!
首頁選單 
首頁選單

Recent

數據載入中...
C++程式設計

 

cin,cout

#include <iostream>

using namespace std;

int main(){

 int number=5;   

  cout<<"This number is "<<number;

return 0;

}

 

 

cin,endl,short

#include <iostream>

using namespace std;

int main(){

 int number=0;

cout<<" I love my number。" ;   

cout<<"This number is "<<number;

return 0;

}

 

short ,

#include <iostream>

using namespace std;

int main(){

 int number=0;

cout<<" I love my number。"<<endl ;   

cout<<"This number is "<<number;

short num_2=32767;

cout<<num_2<<endl;

num_2=32768;

cout<<num_2;

 

 

return 0;

}

 

 

兩數之和

#include <iostream>

using namespace std;

int main(){

 int number_1=10;

int number_2=5;

cout<<number_1<<"與"<<number_2<<"的和="<<number_1+number_2<<endl;

 

 

 

return 0;

}

ASCII code
#include <iostream>
 
using namespace std;
 
int main(){
 
char cht_1;
 
int number_1=10;
 
 
cout<<"Please enter a character:";
cin>>cht_1;
 
cout<<cht_1<<endl;
number_1=cht_1;
cout<<"This character'S ASCII code "<<number_1<<endl;
 
cout<<"Please enter a ASCII code: ";
cin>>number_1;
cht_1=number_1;
cout<<"This character'S ASCII code "<<cht_1;
return 0;

 

瀏覽數