系统无法找到visual studio 2012上指定的文件

时间:2014-02-10 05:55:14

标签: c++ visual-studio-2012

我无法弄清楚我做错了什么,一直说它找不到指定的文件。真的不能弄清楚这个

#include <iostream>
#include <string>
using namespace std;

int main ()
{
    string name;
    double courseNumber;
    double hoursWorked;
    const double payPerHour = 8.25;


    cout << "What is your name and what is your course number? " << endl;
    cin >> "Name " >> name >> " CourseNumber " >> courseNumber;
    cout << name << "Welcome to the C++ course numbered " << 
    courseNumber << endl;

    cout << "How many hours did you work this pay period? " << endl;
    cin >> hoursWorked;
    cout << name << 
    " You worked " << hoursWorked << " hours at " << 
    payPerHour << " per hour. " << endl;

    system("pause");
    return 0;
}

1 个答案:

答案 0 :(得分:1)

 cin >> "Name " >> name >> " CourseNumber " >> courseNumber;

从cin中删除这些字符串它应该可以正常工作。