這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
#include<fstream>#include <iostream>#include<cstdlib>#include<random>#include<ctime>#include<cmath> using namespace std; int main(){ fstream fout; fout.open("text.csv", ios::out | ios::trunc); int seed = clock(); mt19937_64 gen(seed); normal_distribution<double> x(70, 10); int a[100]; double sum = 0; double s = 0; double sum2; for (int i = 0; i < 100; i++){ a[i] = (int)(round(x(gen))); fout << a[i] << ","; fout << "\n"; } fout.close(); system("Pause"); return (0); }
#include<iostream>#include<cstdlib>#include<random>#include<ctime>#include<fstream>using namespace std;int main(){ fstream fout;fout.open("test.csv", ios::out | ios::trunc);int seed = clock();mt19937_64 gen(seed);normal_distribution<double> x(70, 10);int a[1000];double s = 0;for (int i = 0; i < 100; i++){a[i] = x(gen);cout << a[i] << "\t";fout << a[i]<<",\n";s = a[i]+s;if (i % 10 == 9)cout << endl;}fout.close();system("Pause");return 0;}
#include<fstream>#include <iostream>#include<cstdlib>#include<random>#include<ctime>#include<cmath> using namespace std; int main(){ fstream fout; fout.open("text.csv", ios::out | ios::trunc); int seed = clock(); mt19937_64 gen(seed); normal_distribution<double> x(70, 10); int a[100]; double sum = 0; double s = 0; double sum2; for (int i = 0; i < 100; i++){ a[i] = (int)(round(x(gen))); fout << a[i] << ","; fout << "\n"; } fout.close(); system("Pause"); return (0); }
#include #include #includeusing namespace std;int main(){ fstream fout; fout.open("test.csv", ios::out | ios::trunc); fout << "hello, 1,2,3\n"; fout << "hello, 2,2,4\n"; fout.close(); system("Pause"); return 0;}
#include <iostream>#include <fstream>#include <cstdlib>#include <random>#include <ctime>using namespace std;int main(){fstream fout;fout.open("test.csv",ios::out | ios::trunc);int seed = clock();mt19937_64 gen(seed);normal_distribution<double> X(70, 10);double a[1000];double sum = 0;double sum2 = 0;for (int i = 0; i < 1000; i++){a[i] = X(gen);fout << a[i] << "\t";sum += a[i];if (i % 10 == 9)fout << endl;}sum = sum / 1000.0;for (int i = 0; i < 1000; i++){sum2 += (a[i] * a[i]) - (sum * sum);}sum2 = sum2 / 1000;double s = sqrt(sum2);fout << (clock()-seed)/1000.0 <<"sec." << endl;system("Pause");return 0;}
#include <iostream>#include <fstream>#include <cstdlib>#include <random>#include <ctime>using namespace std;int main(){ fstream fout; fout.open("test.csv", ios::out | ios::trunc); int seed = clock(); mt19937_64 gen(seed); normal_distribution<double> X(70, 10); double a[1000]; double sum = 0; double sum2 = 0; for (int i = 0; i < 1000; i++){ a[i] = X(gen); fout << a[i] << "\t"; sum += a[i]; if (i % 10 == 9)fout << endl; } sum = sum / 1000.0; for (int i = 0; i < 1000; i++){ sum2 += (a[i] * a[i]) - (sum * sum); } sum2 = sum2 / 1000; double s = sqrt(sum2); fout << (clock() - seed) / 1000.0 << "sec." << endl; system("Pause"); return 0;}
#include <iostream>#include <fstream>#include <cstdlib>#include <random>#include <ctime>#include <cmath>using namespace std;int main(){ fstream fout; fout.open("test.csv", ios::out | ios::trunc); int seed = clock(); mt19937_64 gen(seed); normal_distribution<double> X(70, 10); double a[1000]; double sum = 0; double sum2 = 0; for (int i = 0; i < 1000; i++){ a[i] = X(gen); cout << a[i] << "\t"; sum += a[i]; if (i % 10 == 9)cout << endl; } sum = sum / 1000.0; for (int i = 0; i < 1000; i++){ sum2 += (a[i] * a[i]) - (sum * sum); } sum2 = sum2 / 1000; double s = sqrt(sum2); cout << (clock() - seed) / 1000.0 << "sec." << endl; system("Pause"); return 0;}
#include<iostream>#include<fstream>#include<cstdlib>#include<random>#include<ctime>using namespace std;int main(){ fstream fout; fout.open("test.csv", ios::out | ios::trunc); int test = clock(); mt19937_64 gen(test); normal_distribution<double>dis(70, 10); int a[100]; for (int i = 0; i < 100; i++){ a[i] = (int)(round(dis(gen))); fout << a[i] << "\n"; } fout.close(); fout << endl; system("Pause"); return 0;}
#include#include #include#include#include#includeusing namespace std;int main(){fstream fout;fout.open("text.csv", ios::out | ios::trunc);int seed = clock();mt19937_64 gen(seed);normal_distribution x(70, 10);int a[100];double sum = 0;double s = 0;double sum2;for (int i = 0; i < 100; i++){a[i] = (int)(round(x(gen)));fout << a[i] << ",";fout << "\n";}fout.close();system("Pause");return (0);}
#include #include #include #include #include using namespace std;int main(){fstream fout;fout.open("test.csv",ios::out | ios::trunc);int seed = clock();mt19937_64 gen(seed);normal_distribution X(70, 10);double a[1000];double sum = 0;double sum2 = 0;for (int i = 0; i < 1000; i++){a[i] = X(gen);fout << a[i] << "\t";sum += a[i];if (i % 10 == 9)fout << endl;}sum = sum / 1000.0;for (int i = 0; i < 1000; i++){sum2 += (a[i] * a[i]) - (sum * sum);}sum2 = sum2 / 1000;double s = sqrt(sum2);fout << (clock()-seed)/1000.0 <<"sec." << endl;system("Pause");return 0;}
#include <iostream>#include <fstream>#include <cstdlib>#include <string>#include <random>#include <ctime>#include <cmath>using namespace std;int main(){ fstream fout; fout.open("test.csv",::ios::out|ios::trunc); int seed=clock(); mt19937_64 gen(seed); normal_distribution<double>dis(70,10); double a[100]; double sum=0; for(int i=0;i<100;i++){ a[i]=(int)(round(dis(gen))); fout<< a[i]; sum+=a[i]; if(i%10==9)fout <<endl; fout.close(); } system("pause"); return 0;}
HTML 編輯器
#include<fstream>
回覆刪除#include <iostream>
#include<cstdlib>
#include<random>
#include<ctime>
#include<cmath>
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include<iostream>
回覆刪除#include<cstdlib>
#include<random>
#include<ctime>
#include<fstream>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> x(70, 10);
int a[1000];
double s = 0;
for (int i = 0; i < 100; i++){
a[i] = x(gen);
cout << a[i] << "\t";
fout << a[i]<<",\n";
s = a[i]+s;
if (i % 10 == 9)cout << endl;
}
fout.close();
system("Pause");
return 0;
}
#include<fstream>
回覆刪除#include <iostream>
#include<cstdlib>
#include<random>
#include<ctime>
#include<cmath>
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include<fstream>
回覆刪除#include <iostream>
#include<cstdlib>
#include<random>
#include<ctime>
#include<cmath>
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include
回覆刪除#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
fout << "hello, 1,2,3\n";
fout << "hello, 2,2,4\n";
fout.close();
system("Pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv",ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock()-seed)/1000.0 <<"sec." << endl;
system("Pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock() - seed) / 1000.0 << "sec." << endl;
system("Pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock() - seed) / 1000.0 << "sec." << endl;
system("Pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
#include <cmath>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
cout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)cout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
cout << (clock() - seed) / 1000.0 << "sec." << endl;
system("Pause");
return 0;
}
#include<iostream>
回覆刪除#include<fstream>
#include<cstdlib>
#include<random>
#include<ctime>
using namespace std;
int main(){
fstream fout;
fout.open("test.csv", ios::out | ios::trunc);
int test = clock();
mt19937_64 gen(test);
normal_distribution<double>dis(70, 10);
int a[100];
for (int i = 0; i < 100; i++){
a[i] = (int)(round(dis(gen)));
fout << a[i] << "\n";
}
fout.close();
fout << endl;
system("Pause");
return 0;
}
#include
回覆刪除#include
#include
#include
#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include
回覆刪除#include
#include
#include
#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include
回覆刪除#include
#include
#include
#include
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv",ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock()-seed)/1000.0 <<"sec." << endl;
system("Pause");
return 0;
}
#include
回覆刪除#include
#include
#include
#include
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv",ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock()-seed)/1000.0 <<"sec." << endl;
system("Pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <string>
#include <random>
#include <ctime>
#include <cmath>
using namespace std;
int main(){
fstream fout;
fout.open("test.csv",::ios::out|ios::trunc);
int seed=clock();
mt19937_64 gen(seed);
normal_distribution<double>dis(70,10);
double a[100];
double sum=0;
for(int i=0;i<100;i++){
a[i]=(int)(round(dis(gen)));
fout<< a[i];
sum+=a[i];
if(i%10==9)fout <<endl;
fout.close();
}
system("pause");
return 0;
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv",ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock()-seed)/1000.0 <<"sec." << endl;
system("Pause");
return 0;
}
#include
回覆刪除#include
#include
#include
#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include <iostream>
回覆刪除#include <fstream>
#include <cstdlib>
#include <random>
#include <ctime>
using namespace std;
int main()
{
fstream fout;
fout.open("test.csv",ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution<double> X(70, 10);
double a[1000];
double sum = 0;
double sum2 = 0;
for (int i = 0; i < 1000; i++){
a[i] = X(gen);
fout << a[i] << "\t";
sum += a[i];
if (i % 10 == 9)fout << endl;
}
sum = sum / 1000.0;
for (int i = 0; i < 1000; i++){
sum2 += (a[i] * a[i]) - (sum * sum);
}
sum2 = sum2 / 1000;
double s = sqrt(sum2);
fout << (clock()-seed)/1000.0 <<"sec." << endl;
system("Pause");
return 0;
}
#include
回覆刪除#include
#include
#include
#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}
#include
回覆刪除#include
#include
#include
#include
#include
using namespace std;
int main(){
fstream fout;
fout.open("text.csv", ios::out | ios::trunc);
int seed = clock();
mt19937_64 gen(seed);
normal_distribution x(70, 10);
int a[100];
double sum = 0;
double s = 0;
double sum2;
for (int i = 0; i < 100; i++){
a[i] = (int)(round(x(gen)));
fout << a[i] << ",";
fout << "\n";
}
fout.close();
system("Pause");
return (0);
}