相关疑难解决方法(0)

如何在C++中提取数字的数字?

基本上我想制作一个小程序,当你输入一个数字(比如145)时,它会读取3位数并打印出最大的数字.

int a,b,c,max;

cout << "Enter a, b and c: ";
cin >> a >> b >> c;

max = a;
if (b>max)
    max = b;
if (c>max)
    max = c;
cout << "Max is " << max << "\n";
Run Code Online (Sandbox Code Playgroud)

我想到使用这样的东西,但我不知道如何让计算机读取每个数字.谢谢!

c++

0
推荐指数
1
解决办法
2486
查看次数

标签 统计

c++ ×1