#include <iostream>
using namespace std;
int main()
{
// Part A
int day;
char month[256];
int year;
char name[256];
char state[2];
cout << "Please enter your name." ;
cin >> name;
cout << "Please enter the month (not the number), day, and the
year.";
cin >> month >> day >> year;
cout << "Please enter the state you are located in.";
cin.getline(state, 256);
好的,所以我需要输入一个州(美国州)的信息。当我运行它时,它只是跳过应该询问状态的地方。到底出了什么问题?
我还将如何正确格式化getline以获取多个输入(如您所见):
cin >> month >> day >> year;
在Cinline无法正常工作以及如何获得多个输入的情况下,Cant似乎找不到答案,这让我感到沮丧。我快要哭了!请帮助