#include <iostream>
#include <string>
#include <cmath>
#include <fstream>
#include <stdio.h>
//#pragma warning(disable:4996) //汚い・・・。Orz
std::string MakeHeader(){
std::string str;
str = "<head>";
str += "<title>こんなんでいいんですかね??</title>";
str += "</head>";
return str;
}
std::string MakeBody(){
std::string str;
char Buf[1024];
str = "<body>";
for (int i = 0; i < 180; i++){
str += "<hr width=\"";
std::sprintf(Buf, "%d", static_cast<int>(100 * std::sin((i)*(3.1415926463 / 180.0))));
str += Buf;
//str += _itoa(static_cast<int>(100*std::sin((i - 45)*(3.1415926463 / 180.0))), Buf, 10);
str +="\">";
str += "\n";
}
str += "</body>";
return str;
}
std::string CreateHTML(){
std::string str;
str = "<html>";
str += MakeHeader();
str += MakeBody();
str += "</html>";
return str;
}
bool Write(std::ostream& os, std::string& str){
os << str;
return true;
}
int main(){
std::string str = CreateHTML();
std::ofstream ofs("hoge.html");
Write(std::cout, str);
//Write(ofs,str);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxmc3RyZWFtPgojaW5jbHVkZSA8c3RkaW8uaD4KCi8vI3ByYWdtYSB3YXJuaW5nKGRpc2FibGU6NDk5NikgLy/msZrjgYTjg7vjg7vjg7vjgIJPcnoKCnN0ZDo6c3RyaW5nIE1ha2VIZWFkZXIoKXsKCXN0ZDo6c3RyaW5nIHN0cjsKCglzdHIgPSAiPGhlYWQ+IjsKCXN0ciArPSAiPHRpdGxlPuOBk+OCk+OBquOCk+OBp+OBhOOBhOOCk+OBp+OBmeOBi+OBre+8n++8nzwvdGl0bGU+IjsKCXN0ciArPSAiPC9oZWFkPiI7CgoJcmV0dXJuIHN0cjsKfQpzdGQ6OnN0cmluZyBNYWtlQm9keSgpewoJc3RkOjpzdHJpbmcgc3RyOwoJY2hhciBCdWZbMTAyNF07CgoJc3RyID0gIjxib2R5PiI7CgkKCWZvciAoaW50IGkgPSAwOyBpIDwg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