首页 > 试题广场 >

编写一个程序,让用户输入其年龄,然后显示该年龄包含多少个月,

[问答题]
编写一个程序,让用户输入其年龄,然后显示该年龄包含多少个月,如下所示:
Enter your age: 29
编辑于 2019-03-13 06:54:21 回复(0)
#include <iostream>

using namespace std;

int main()
{
    int age;
    cin>>age;
    cout<<"your months of age:"<<age*12<<endl;
    return 0;
}

编辑于 2020-06-24 14:24:51 回复(0)
#include<iostream>
using namespace std;
int main()
{
    int age;
    cin>>age;
    cout<<"总共有"<<12*age<<endl;
    return 0;
}

发表于 2020-01-31 18:38:34 回复(0)
#include
发表于 2020-01-02 16:21:56 回复(0)
#include <iostream>

int main()
{
	int nAge;

	std::cout << "Enter your age: ";
	std::cin >> nAge;

	std::cout << "您一共度过了" << nAge * 12 << " 个月" << std::endl;
}

发表于 2019-10-31 09:58:17 回复(0)
#include <iostream>
using namespace std;

int main(void)

{
    int year;
    cout<<"Enter your age:";
    cin>>year;
    cout<<"世界上存在"<<year*12<<"个月了"<<endl;
    
    return 0;
}

发表于 2019-03-16 22:56:20 回复(0)
#include<iostream>
using namespace std;
int main()
{
 int age;
 cout<<"Enter your age:";
 cin>>age;
 cout<<"You are "<<12*age<<" months old.";
 return 0;
}

发表于 2019-01-23 18:17:13 回复(0)