#include <iostream> #include <vector> #include <string> #include <stdio.h> #include <stdlib.h> #include <cgicc/CgiDefs.h> #include <cgicc/Cgicc.h> #include <cgicc/HTTPHTMLHeader.h> #include <cgicc/HTMLClasses.h> using namespace std; using namespace cgicc; int main () { Cgicc formData; cout << "Content-type:text/html;charset=utf-8\n\n"; // 告诉浏览器字符编码 cout << "<html>\n"; cout << "<head>\n"; cout << "<title> C++ web 编程</title>\n"; cout << "</head>\n"; cout << "<body>\n"; int space, rows; cout <<"打印三角形: <br/>"; // cin >> rows; rows=7; for(int i = 1, k = 0; i <= rows; ++i, k = 0) { for(space = 1; space <= rows-i; ++space) { cout <<" "; } while(k != 2*i-1) { cout << "*"; ++k; } cout << "<br/>"; cout << endl; } return 0; }