Menu
CoddyTech

挑战 3

Coddy C++ 文件处理 课程的第 23 课,共 23 课。

challenge icon

挑战

简单

编写一个程序,从文件 input.txt 中读取输入。你会得到 5 个数字,请计算每个数字的约数数量,并用空格分隔后写入输出文件 output.txt。

输入
5 7 10 8 12

输出
2 2 4 4 6

亲手试试

#include <iostream>
#include <fstream>

using namespace std;

int main() 
{
    
    // 在这里输入你的代码
    
    
    
    // 不要修改下面的代码!
    ifstream file("output.txt")
    string line;
    getline(file, line);
    cout << line;
    file.close()
}

C++ 文件处理中的所有课

自己练习: C++ 在线编译器