herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
計算你的BMI
-
GCD(10^10+1, 10^11+2)=?
-
輸出你的課表 含Java code以及結果
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
請用 C/C++/java寫一簡易程式
-
一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",...
-
BMI (Body Mass Index)= 體重 (kg) / 身高 ^2(m 2 ) 在台灣,行政院衛生署乃根據其相關研究,於2002年4月公佈台灣成人肥胖標準: BMI<18.5 為過輕, 18.5≦BMI<24 為正常體重, 24≦BMI<27 為過重, BM...
-
33, 45, 87, 99, 27 算平均
7 則留言:
#include <iostream>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include <iostream>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
#include
#include
#include
#include
using namespace std;
struct student
{
int id;
string name;
int java;
int math;
int cpp;
bool sex;
};
void print(student X, ostream& ff)
{
ff << X.id << "," ;
ff << X.name << ",";
ff << X.java << ",";
ff << X.math << ",";
ff << X.cpp << ",";
ff << X.sex << ",";
ff << "\n";
}
void read(student&X, fstream& ff)
{
ff >> X.id;
ff >> X.name;
ff >> X.java;
ff >> X.math;
ff >> X.cpp;
ff >> X.sex;
}
int main()
{
student Y[10];
fstream ff, fout;
ff.open("test.txt", ios::in);
fout.open("ost.csv", ios::out);
for (int i = 0; i < 10; i++)
{
read(Y[i], ff);
print(Y[i], cout);
print(Y[i],fout);
}
fout.close();
ff.close();
system("Pause");
return 0;
}
張貼留言