-1
#include <iostream>
using namespace std;

int Main ()
{
    cout << "---------------------------------------------------------------------------------/n";
    cout << "NAME: Justin Chiang/n";
    cout << "COMPUTER LANGUAGES: Python, Lua, C++/n";
    cout << "FAVORITE VIDEO GAME: Starcraft, Diablo/n";
    cout << "I'm taking this class for math undergrad requirement and because it is very useful." << endl;
    system("PAUSE");
    return 0;
}

出力:

1>------ Build started: Project: HW1, Configuration: Debug Win32 ------
1>  HW1.cpp
1>c:\users\asus\desktop\hw1\hw1\hw1.cpp(5): warning C4627: '#include <iostream>': 
            skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\asus\desktop\hw1\hw1\hw1.cpp(25): fatal error C1010: unexpected end of file 
            while looking for precompiled header. Did you forget to add '#include  
            "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
4

3 に答える 3

0

int Main ()小文字にする必要があります。に変更しint main ()ます。

cout << "... /n"; に変更cout << "... \n";

#include <iostream>
using namespace std;

int main ()
{
    cout << "---------------------------------------------------------------------------------\n";
    cout << "NAME: Justin Chiang\n";
    cout << "COMPUTER LANGUAGES: Python, Lua, C++\n";
    cout << "FAVORITE VIDEO GAME: Starcraft, Diablo\n";
    cout << "I'm taking this class for math undergrad requirement and because it is very useful." << endl;
    system("PAUSE");
    return 0;
}
于 2012-09-10T07:21:16.280 に答える