6
EMBOX_CMD(hello_srs_main);
10
void Multiply(int a[], int b[], int result[]) {
12
for (int i = 1; i <= a[0]; i++) {
13
for (int j = 1; j <= b[0]; j++) {
14
result[i + j - 1] += a[i] * b[j];
18
result[0] = a[0] + b[0] + 1;
21
void Assigment(int a[], int c[]) {
22
for (int i = 1; i <= c[0]; i++){
34
for (int i = 1; i <= c[0]; i++) {
36
c[i + 1] += c[i] / 10;
41
while (c[length] == 0) {
47
void Read(int numb, int a[]) {
48
char* number = (char*)malloc(100);
49
sprintf(number, "%d", numb);
54
for (i = strlen(number) - 1; i >= 0; i--) {
55
a[index] = number[i] - '0';
58
a[0] = strlen(number);
63
for (int i = a[0]; i > 0; i--)
68
for (int i = 0; i < strlen(str); i++)
73
static int hello_srs_main(int argc, char *argv[] )
75
int a[N], b[N], c[2 * N], flag = 0;
80
const char *method = getenv("REQUEST_METHOD");
83
if( !strcmp(method,"POST") )
86
len = atoi( getenv("CONTENT_LENGTH") );
87
query = (char*)malloc(len+1);
88
fread(query, 1, len, stdin);
91
else if( !strcmp(method,"GET") )
93
query=(char*)malloc(strlen(getenv("QUERY_STRING"))+1);
94
strcpy(query,getenv("QUERY_STRING"));
96
else printf("unknown REQUEST_METHOD\n");
99
if ( !strncmp(query, query1, 4) )
103
char* tmp = strstr(query, "=");
105
for(int i = 1; i < sizeof(tmp); i++)
107
for (int i = 2; i <= atoi(query); i++) {
115
if ( !strncmp(query, query2, 4) )
118
char* tmp = strstr(query, "=");
120
for(int i = 1; i < sizeof(tmp); i++)
122
FILE *File = fopen(query, "rt");
125
fgets(str, sizeof(str), File);
136
"Content-Type: %s\r\n"
137
"Connection: close\r\n"
138
"\r\n", 200, "OK", "text/html");
142
"<TITLE>Fact</TITLE>"