×¢²á µÇ¼
±à³ÌÂÛ̳ ¡ú C++½ÌÊÒ

Îұ಻ÁË£¬Äĸö´í£¬°ÝÍиßÊÖ°ïæ¸ÄÕý

hujihong520 ·¢²¼ÓÚ 2013-10-11 15:56£¬ 626 ´Îµã»÷
#include<iostream>
using namwspace std;
int main()
{
    double a,b,c;
    char x,y,z;
    cout<<"ÇëÊäÈë¿ÆÄ¿£º";
    cin>>x>>y>>z;
    cout<<"ÇëÊäÈë¶ÔÓ¦³É¼¨£º";
    cin>>a>>b>>c;
    cout<<endl;
    cout<<"        ³É¼¨µ¥       "<<endl;
    cout<<"-------------------- "<<endl;
    cout<<"x"<<"y"<<"z"<<endl:
    cout<<"|"<<setiosflangs(ios::fixed)<<setiosflangs(ios::right)<<setprectsion(7)<<setw(2)<<"a"<<"|"<<"b"<<"|"<<"c"<<endl;
    cout<<"-------------------- "<<endl;
}
7 »Ø¸´
#2
rjsp2013-10-11 16:05
ÄãÓ¦¸ÃÕâôÎÊ£º
using namwspace std; ÕâÐбàÒëÆ÷±¨´íΪ£ºsyntax error : missing ';' before identifier 'std'£¬'namwspace' : symbol cannot be used in a using-declaration

±ðÈ˾ͻáÁ¢¼´¿´³öÄã°Ñ namespace ƴд´íÁË
#3
hujihong5202013-10-11 16:06
ÎÒÇó¼±Óã¬¿ì¸ø´ð°¸°¡
#4
hujihong5202013-10-11 16:22
回å? 2æ¥
求具体答案
#5
hujihong5202013-10-11 16:24
#include<iostream>
using namespace std;
int main()
{
    double a,b,c;
    char x,y,z;
    cout<<"ÇëÊäÈë¿ÆÄ¿£º"<<endl;
    cin>>x>>y>>z;
    cout<<"ÇëÊäÈë¶ÔÓ¦³É¼¨£º"<<endl;
    cin>>a>>b>>c;
    cout<<endl;
    cout<<"        ³É¼¨µ¥       "<<endl;
    cout<<"-------------------- "<<endl;
    cout<<"|"<<"x"<<"|"<<"y"<<"|"<<"z"<<"|"<<endl;
    cout<<"|"<<setiosflangs(ios::fixed)<<setiosflangs(ios::right)<<setprectsion(7)<<setw(2)<<"a"<<"|"<<"b"<<"|"<<"c"<<endl;
    cout<<"-------------------- "<<endl;
    return 0;
}
ÉÏÃæÎÒ¸ÄÁË£¬ÈÔÈ»±à²»ÁË£¬ÎªºÎ£¿°ÝÍиßÊÖ°ï½â¾ö°¡
#6
Çóѧ²ËÄñ12013-10-11 21:53
Â¥Ö÷ÄãҲ̫´ÖÐÄÁ˰ɣ¬Õâô¶àƴд´íÎó¡£Çë×¢ÒâÊÇsetiosflags.»¹ÓÐsetprecision.
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    double a,b,c;
    char x,y,z;
    cout<<"ÇëÊäÈë¿ÆÄ¿£º"<<endl;
    cin>>x>>y>>z;
    cout<<"ÇëÊäÈë¶ÔÓ¦³É¼¨£º"<<endl;
    cin>>a>>b>>c;
    cout<<endl;
    cout<<"        ³É¼¨µ¥       "<<endl;
    cout<<"-------------------- "<<endl;
    cout<<"|"<<"x"<<"|"<<"y"<<"|"<<"z"<<"|"<<endl;
    cout<<"|"<<setiosflags(ios::fixed)<<setiosflags(ios::right)<<setprecision(7)<<setw(2)<<"a"<<"|"<<"b"<<"|"<<"c"<<endl;
    cout<<"-------------------- "<<endl;
    return 0;
}
#7
ITÄÐyear2013-10-12 08:44
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
     double a,b,c;
     string x,y,z;
     cout<<"ÇëÊäÈë¿ÆÄ¿£º";
     cin>>x>>y>>z;
     cout<<"ÇëÊäÈë¶ÔÓ¦³É¼¨£º";
     cin>>a>>b>>c;
     cout<<endl;
     cout<<"        ³É¼¨µ¥       "<<endl;
     cout<<"-------------------- "<<endl;
     cout<<"  "<<x<<"  "<<y<<"  "<<z<<endl;
     cout<<"  "<<setiosflags(ios::fixed)<<setiosflags(ios::right)<<setprecision(2)<<setw(2)<<a<<"  "<<b<<"  "<<c<<endl;
     cout<<"-------------------- "<<endl;
     return 0;
}
#8
a4624105942013-10-12 16:53
ÎÒÒ²ÕýÔÚѧc++¡£ÓõÄÊÇvs 2008µÄ£¬±àÒëÓдíʱ£¬ÊÇÒÔÖÐÎÄÀ´ÌáʾµÄ£¬·½±ãºÜ¶à£¬½¨ÒéÄãÒ²ÓÃÓÃ
1