zoukankan      html  css  js  c++  java
  • Web 服务器配置

    Web 服务器配置
    在您进行 CGI 编程之前,请确保您的 Web 服务器支持 CGI,并已配置成可以处理 CGI 程序。所有由 HTTP 服务器执行的 CGI 程序,都必须在预配置的目录中。该目录称为 CGI 目录,按照惯例命名为 /var/www/cgi-bin。虽然 CGI 文件是 C++ 可执行文件,但是按照惯例它的扩展名是 .cgi。

    默认情况下,Apache Web 服务器会配置在 /var/www/cgi-bin 中运行 CGI 程序。

     1 #include <iostream>
     2 #include <string.h>
     3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
     4 using namespace std;
     5 string name[50],num[50];
     6 int n;
     7 int main(int argc, char** argv) {
     8     void input_data();
     9     void search (string find_name);
    10     string find_name;
    11     cout <<"please input number of this class:";
    12     cin >>n;
    13     input_data();
    14     cout <<"please input name you want find:";
    15     cin >>find_name;
    16     search(find_name);
    17     return 0;
    18 }
    19 
    20 void input_data()
    21 {
    22     int i;
    23     for(i=0;i<n;i++)
    24     {
    25         cout <<"input name and number of student"<<i+1<<":";
    26         cin>>name[i]>>num[i];
    27     }
    28 }
    29 
    30 void search(string find_name)
    31 {
    32     int i;
    33     bool flag=false;
    34     for(i=0;i<n;i++)
    35     if(name[i]==find_name)
    36     {
    37         cout <<name[i]<<"has been found,his number is"<<num[i]<<endl;
    38         flag=true;
    39         break;
    40     }
    41     if(flag==false)cout<<"can't find this name";
    42 }
  • 相关阅读:
    #树#遍历#N叉树的前序遍历
    #树#递归#最大二叉树II
    #树#递归#二叉树的镜像
    #树#递归#最大二叉树
    #树#二叉搜索树的最近公共祖先
    #树#二叉树的直径
    #树#N叉树的后序遍历
    #树#判断平衡二叉树
    webpack+react+nodejs+express前端开发环境搭建
    sublime 玩转react+es6
  • 原文地址:https://www.cnblogs.com/borter/p/9401334.html
Copyright © 2011-2022 走看看