最近一日が早いです。
Resently, I feel a day is less than 24 hours.
まじめに授業でてるってのもあるんでしょうけど。
hmm, why i feel may be I take a class soberly...
C++のほうはなんとかついていってますけど、色々とわかんないとこもあったり。
I take a C++ class...I have some problem...
cin>>address
getline(cin,address2)
アドレスを入力させるやつなんですけど、cinだとスペースの先認識しないし、getlineだけだとおかしいことなるし・・・。
This is a program of Showing User's adress. but if I use cin, it doesn't recognize after space, if I use getline, it doesn't work well...
というわけで苦肉の策として上みたいにしたら上手くいったんでごり押しやなーとかおもいながら宿題終わらせました。
So, I use heavy-handed tactics as a last resort..Finally, it works...but it's not smart way....so i'm still thinking..
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
void main()
{
string La,Fi,Ad,Ad2,Ci,St;//Last,First,Address1&2,City,Street.
char Mi;//Middle
int Zi;//Zip code
cout<<"Please type your Last Name, First Name, and Middle Name.\n";
cin>>La>>Fi>>Mi;
cout<<"Please type your Address.\n";
cin>>Ad;
getline(cin,Ad2);
cout<<"Please type your City, State, and Zip code.\n";
cin>>Ci>>St>>Zi;
cout<<setw(10)<<"Last"<<setw(10)<<"First"<<setw(10)<<"Middle"<<setw(20)
<<"Address"<<setw(10)<<"City"<<setw(10)<<"State"<<setw(10)<<"Zip"<<endl;
cout<<setw(10)<<La<<setw(10)<<Fi<<setw(10)<<Mi<<setw(20)<<Ad+Ad2<<setw(10)
<<Ci<<setw(10)<<St<<setw(10)<<Zi<<endl;
}
Please type your Last Name, First Name, and Middle Name.
Shunsuke Kita A
Please type your Address.
115 Pine St.
Please type your City, State, and Zip code.
Florence Al 35630
Last First Middle Address City State Zip
Shunsuke Kita A 115 Pine St. Florence Al 35630
Press any key to continue . . .
今日の宿題はsetwを使えってもんだったんす。
I must use setw in today's HW..