1、
#include <iostream>
int main(int argc, char* argv[])
{
char firstName[50] = {0};
char lastName[50] = {0};
char grade;
int age;
std::cout << "What is your first name? ";
std::cin.getline(firstName, 49);
std::cout << "What is your last name? ";
std::cin.getline(lastName, 49);
std::cout << "What letter grade do you deserve? ";
std::cin >> grade;
std::cout << "What is your age? ";
std::cin >> age;
std::cout << "Name: "<< lastName << ", "<< firstName <<std::endl;
std::cout << "Grade: "<< (char)(grade + 1) <<std::endl;
std::cout << "Age: "<< age <<std::endl;
return 0;
}
原文地址:https://www.cnblogs.com/f00345709/p/9091086.html
时间: 2024-10-09 23:49:50