,   CyberForum.ru

. - C++

C++ http://www.cyberforum.ru/cpp-beginners/thread363092.html
ipch
C++ . , , ? http://www.cyberforum.ru/cpp-beginners/thread363084.html
C++
! , . 2 : Base Derived, Derived Base. : "Error C2512: Base: d:\doc\dev\visual studio 2010\test\test\Derived.h 7 1 Test". : Base.h:#pragma once class Base { public: Base(int a) { }
C++ while
C++ clas Char_vec http://www.cyberforum.ru/cpp-beginners/thread363050.html
: : class Char vec { int sz; char element ; public: static Char_vec* new char vec {int s) ; char& operator (int i) { return element ; } };
C++ C++ !:curtsy: .:gsmile: 1. , "0"(). . 2. 10 : - , - . ...

0 / 0 / 0
: 16.12.2010
: 32
08.10.2011, 18:30  []     .
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <conio.h>
#include <stdio.h>
AnsiString triada(AnsiString in, int tn)
{
if (in == "   ") return "";
if (in == "000") return "";
AnsiString out = "";
AnsiString sotni[9] = 
{"ñòî", "äâåñòè", "òðèñò*", "÷åòûðåñò*", "ïÿòüñîò",
"øåñòüñîò", "ñåìüñîò", "âîñåìüñîò", "äåâÿòüñîò"};
AnsiString dubl[10] = 
{"äåñÿòü", "îäè***äö*òü", "äâå**äö*òü", "òðè**äö*òü", "÷åòûð**äö*òü",
"ïÿò**äö*òü", "øåñò**äö*òü", "ñåì**äö*òü", "âîñåì**äö*òü", "äåâÿò**äö*òü"};
AnsiString des[8] = 
{"äâ*äö*òü", "òðèäö*òü", "ñîðîê", "ïÿòüäåñÿò",
"øåñòüäåñÿò", "ñåìüäÿñÿò", "âîñåìüäÿñÿò", "äåâÿ*îñòî"};
AnsiString ed[9] = {"îäè*", "äâ*", "òðè", "÷åòûðå", "ïÿòü", "øåñòü","ñåìü", "âîñåìü", "äåâÿòü"};
AnsiString edj[9] = {"îä**", "äâå", "òðè", "÷åòûðå", "ïÿòü", "øåñòü","ñåìü", "âîñåìü", "äåâÿòü"};
AnsiString ind[5] = {"", " òûñÿ÷", " ìèëëèî*", " ìèëëè*ðä", " òðèëëèî*"};
AnsiString post;
if (in[1] != ' ') if (in[1] != '0')
        { out = out + sotni[StrToInt(in[1])-1]; }
if (in[2] == '1')
        { out = out + " " + dubl[StrToInt(in[3])]; }
if (in[2] != '1') if (in[2] != ' ') if (in[2] != '0')
        { out = out + " " + des[StrToInt(in[2])-2]; }
if (in[3] != '0') if (in[2] != '1')
        {
        if (tn == 1)
                out = out + " " + edj[StrToInt(in[3])-1];
        if (tn != 1)
                out = out + " " + ed[StrToInt(in[3])-1];
        }
if (tn>0) if (in[2] != '1')
        {
        if (tn==1) switch (in[3])
                {
                case '1': post = ind[tn] + "*"; break;
                case '2': post = ind[tn] + "è"; break;
                case '3': post = ind[tn] + "è"; break;
                case '4': post = ind[tn] + "è"; break;
                default : post = ind[tn] + ""; break;
                }
        if ((tn==2)||(tn==3)||(tn==4)) switch (in[3])
                {
                case '1': post = ind[tn] + ""; break;
                case '2': post = ind[tn] + "*"; break;
                case '3': post = ind[tn] + "*"; break;
                case '4': post = ind[tn] + "*"; break;
                default : post = ind[tn] + "îâ"; break;
                }
        }
else
        {
        switch (tn)
                {
                case 1  : post = ind[tn]; break;
                default : post = ind[tn] + "îâ"; break;
                }
        }
out = out + post;
return out;
}
AnsiString summa(AnsiString in)

Output
Building main.obj.
E:\v\2 \T++\T3 2\main.c(3): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(3): error #2001: Syntax error: found 'triada' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(3): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(3): error #2001: Syntax error: found 'in' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(3): error #2001: Syntax error: found ')' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(3): error #2011: Declared parameter 'tn' is missing.
E:\v\2 \T++\T3 2\main.c(5): warning #2027: Missing prototype for 'triada'.
E:\v\2 \T++\T3 2\main.c(5): error #2001: Syntax error: found '(' - expecting '{'.
E:\v\2 \T++\T3 2\main.c(5): error #2048: Undeclared identifier 'in'.
E:\v\2 \T++\T3 2\main.c(5): error #2168: Operands of == have incompatible types 'int' and 'char *'.
E:\v\2 \T++\T3 2\main.c(5): error #2001: Syntax error: found 'return' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(5): error #2060: Illegal return type; found 'char *' expected 'int'.
E:\v\2 \T++\T3 2\main.c(6): error #2168: Operands of == have incompatible types 'int' and 'char *'.
E:\v\2 \T++\T3 2\main.c(6): warning #2154: Unreachable code.
E:\v\2 \T++\T3 2\main.c(6): error #2060: Illegal return type; found 'char *' expected 'int'.
E:\v\2 \T++\T3 2\main.c(7): error #2001: Syntax error: found 'out' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(7): error #2048: Undeclared identifier 'out'.
E:\v\2 \T++\T3 2\main.c(7): error #2168: Operands of = have incompatible types 'int' and 'char *'.
E:\v\2 \T++\T3 2\main.c(8): error #2001: Syntax error: found 'sotni' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(8): error #2048: Undeclared identifier 'sotni'.
E:\v\2 \T++\T3 2\main.c(8): error #2144: Type error: pointer expected.
E:\v\2 \T++\T3 2\main.c(9): error #2039: Illegal expression.
E:\v\2 \T++\T3 2\main.c(9): error #2001: Syntax error: found "\xf1\xf2\xee" - expecting ';'.
E:\v\2 \T++\T3 2\main.c(10): error #2001: Syntax error: found '}' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(10): warning #2096: Missing return value.
E:\v\2 \T++\T3 2\main.c(11): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(11): error #2001: Syntax error: found 'dubl' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(11): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(12): warning #2004: Compatibility of 'char' and 'wchar_t' is compiler dependent.
E:\v\2 \T++\T3 2\main.c(12): error #2001: Syntax error: found "\xee\xe4\xe8\xed\xed\xe0\xe4\xf6\xe0\xf2\xfc" - expecting '}'.
E:\v\2 \T++\T3 2\main.c(14): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(14): error #2001: Syntax error: found 'des' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(14): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(15): warning #2004: Compatibility of 'char' and 'wchar_t' is compiler dependent.
E:\v\2 \T++\T3 2\main.c(15): error #2001: Syntax error: found "\xf2\xf0\xe8\xe4\xf6\xe0\xf2\xfc" - expecting '}'.
E:\v\2 \T++\T3 2\main.c(17): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(17): error #2001: Syntax error: found 'ed' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(17): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(17): warning #2004: Compatibility of 'char' and 'wchar_t' is compiler dependent.
E:\v\2 \T++\T3 2\main.c(17): error #2001: Syntax error: found "\xe4\xe2\xe0" - expecting '}'.
E:\v\2 \T++\T3 2\main.c(18): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(18): error #2001: Syntax error: found 'edj' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(18): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(18): warning #2004: Compatibility of 'char' and 'wchar_t' is compiler dependent.
E:\v\2 \T++\T3 2\main.c(18): error #2001: Syntax error: found "\xe4\xe2\xe5" - expecting '}'.
E:\v\2 \T++\T3 2\main.c(19): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(19): error #2001: Syntax error: found 'ind' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(19): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(19): warning #2004: Compatibility of 'char' and 'wchar_t' is compiler dependent.
E:\v\2 \T++\T3 2\main.c(19): error #2001: Syntax error: found " \xf2\xfb\xf1\xff\xf7" - expecting '}'.
E:\v\2 \T++\T3 2\main.c(20): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(20): error #2001: Syntax error: found 'post' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(20): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(21): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(21): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(21): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(21): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(21): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(21): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(21): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(22): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(22): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(22): error #2048: Undeclared identifier 'sotni'.
E:\v\2 \T++\T3 2\main.c(22): warning #2027: Missing prototype for 'StrToInt'.
E:\v\2 \T++\T3 2\main.c(22): error #2144: Type error: pointer expected.
E:\v\2 \T++\T3 2\main.c(22): error #2069: Initializer must be constant.
E:\v\2 \T++\T3 2\main.c(22): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(23): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(23): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(23): error #2001: Syntax error: found '==' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(23): error #2120: Redeclaration of 'in' previously declared at E:\v\2 \T++\T3 2\main.c(21): found 'int [2]' expected 'int [1]'.
E:\v\2 \T++\T3 2\main.c(23): error #2001: Syntax error: found '==' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(23): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(23): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(24): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(24): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(24): error #2123: Redefinition of 'out' previously defined at E:\v\2 \T++\T3 2\main.c(22).
E:\v\2 \T++\T3 2\main.c(24): error #2082: Invalid initialization type; found 'char *' expected 'int'.
E:\v\2 \T++\T3 2\main.c(24): error #2069: Initializer must be constant.
E:\v\2 \T++\T3 2\main.c(24): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(25): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(25): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(26): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(26): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(26): error #2123: Redefinition of 'out' previously defined at E:\v\2 \T++\T3 2\main.c(24).
E:\v\2 \T++\T3 2\main.c(26): error #2082: Invalid initialization type; found 'char *' expected 'int'.
E:\v\2 \T++\T3 2\main.c(26): error #2069: Initializer must be constant.
E:\v\2 \T++\T3 2\main.c(26): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(27): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(27): error #2120: Redeclaration of 'in' previously declared at E:\v\2 \T++\T3 2\main.c(25): found 'int [3]' expected 'int [2]'.
E:\v\2 \T++\T3 2\main.c(27): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(27): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(27): error #2120: Redeclaration of 'in' previously declared at E:\v\2 \T++\T3 2\main.c(27): found 'int [2]' expected 'int [3]'.
E:\v\2 \T++\T3 2\main.c(27): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(27): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(28): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(29): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(29): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(29): error #2001: Syntax error: found '==' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(29): error #2001: Syntax error: found '==' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(29): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(29): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(30): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(30): error #2123: Redefinition of 'out' previously defined at E:\v\2 \T++\T3 2\main.c(26).
E:\v\2 \T++\T3 2\main.c(30): error #2082: Invalid initialization type; found 'char *' expected 'int'.
E:\v\2 \T++\T3 2\main.c(30): error #2069: Initializer must be constant.
E:\v\2 \T++\T3 2\main.c(31): error #2156: Unrecognized declaration.
E:\v\2 \T++\T3 2\main.c(31): warning #2099: Missing type specifier.
E:\v\2 \T++\T3 2\main.c(31): error #2001: Syntax error: found '!=' - expecting ')'.
E:\v\2 \T++\T3 2\main.c(31): error #2001: Syntax error: found '!=' - expecting ';'.
E:\v\2 \T++\T3 2\main.c(31): fatal error #2210: More than 100 errors, please improve yourself.
If you are compiling a Windows program: make sure you use the /Ze option!
*** Error code: 1 ***
Done.


8
2, 2:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
char *itonumeral_ru( int n, size_t size, char *buf );
 
int main()
{
    char *str;
    char *buf;
    int choice;
    while(1)
    {
        printf("Vvedite chislo:\t");
        scanf("%u", &choice);
        str = itonumeral_ru(choice, 256, buf);
        printf("%s\n", str);
    }
    return 0;
}
 
char *itonumeral_ru( int n, size_t size, char *buf )
{
    char *one[] = {"","îäè* ","äâ* ","òðè ","÷åòûðå ","ïÿòü ","øåñòü ","ñåìü ","âîñåìü ","äåâÿòü ",
                  "äåñÿòü ","îäè***äö*òü ","äâå**äö*òü ","òðè**äö*òü ","÷åòûð**äö*òü ","ïÿò**äö*òü ",
                  "øåñò**äö*òü ","ñåì**äö*òü ","âîñåì**äö*òü ","äåâÿò**äö*òü " };
    char *ten[] = {"","", "äâ*äö*òü ", "òðèäö*òü ", "ñîðîê ", "ïÿòüäåñÿò ", "øåñòüäåñÿò ", "ñåìüäåñÿò ", 
                  "âîñåìüäåñÿò ", "äåâÿ*îñòî " };
    char *hundred[] = {"","ñòî ","äâåñòè ", "òðèñò* ", "÷åòûðåñò* ", "ïÿòüñîò ", "øåñòüñîò ", 
                      "ñåìüñîò ", "âîñåìüñîò ", "äåâÿòüñîò " };
    char *thouOne[] =  {"","îä** ","äâå ","òðè ","÷åòûðå ","ïÿòü ","øåñòü ","ñåìü ","âîñåìü ","äåâÿòü ",
                  "äåñÿòü ","îäè***äö*òü ","äâå**äö*òü ","òðè**äö*òü ","÷åòûð**äö*òü ","ïÿò**äö*òü ",
                  "øåñò**äö*òü ","ñåì**äö*òü ","âîñåì**äö*òü ","äåâÿò**äö*òü " };                     
    char *thousand[] = {"òûñÿ÷ ", "òûñÿ÷* ", "òûñÿ÷è ", "òûñÿ÷è ", "òûñÿ÷è ", "òûñÿ÷ " ,"òûñÿ÷ ", "òûñÿ÷ ",
                "òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ ","òûñÿ÷ "
                "òûñÿ÷ "};
    buf = malloc(size);
    sprintf(buf, "%u", n);
    int len = strlen(buf);
    int temp, temp2;
        switch(len)
{
    case 1:
        sprintf(buf,"%s", one[n]);
        break;
    case 2:
        if(n < 20)
        {
            sprintf(buf,"%s", one[n]);
        }
        else if(n < 100)
        {
            if((n%10)==0) sprintf(buf,"%s", ten[n/10]);
            else sprintf(buf,"%s%s", ten[n/10], one[n%10]);
        }
        break;
    case 3:
        temp = n/100;
        n -= (n/100)*100;
        if(n < 20)
        {
            sprintf(buf,"%s%s", hundred[temp], one[n]);
            
        }
        else if(n < 100)
        {
            if((n%10)==0) sprintf(buf,"%s%s", hundred[temp], ten[n/10]);
            else sprintf(buf,"%s%s%s", hundred[temp], ten[n/10], one[n%10]);
        }
        break;
    case 4:
        temp = n/1000;
        n -= (n/1000)*1000;
        sprintf(buf,"%s%s", thouOne[temp], thousand[temp]);
        temp = n/100;
        n -= (n/100)*100;
        if(n < 20)
        {
            strncat(buf, hundred[temp], 30);
            strncat(buf, one[n], 15);
        }
        else if(n < 100)
        {
            if((n%10)==0){
                 strncat(buf, hundred[temp], 30);
                 strncat(buf, ten[n/10], 30); 
             }
            else {
                strncat(buf, hundred[temp], 30);
                strncat(buf, ten[n/10], 30); 
                strncat(buf, one[n%10], 30);
            }
        }
        break;
    case 5:
        temp = n/1000;
        n -= (n/1000)*1000;
        if(temp<20){
            sprintf(buf,"%s%s", thouOne[temp], thousand[temp%10]);
        }
        else if(temp < 100)
        {
            if((temp%10)==0) sprintf(buf,"%s%s", ten[temp/10], thousand[temp%10]);
            else sprintf(buf,"%s%s%s", ten[temp/10], thouOne[temp%10], thousand[temp%10]);
        }
        temp = n/100;
        n -= (n/100)*100;
        if(n < 20)
        {
            strncat(buf, hundred[temp], 30);
            strncat(buf, one[n], 30);
            
        }
        else if(n < 100)
        {
            if((n%10)==0){
                 strncat(buf, hundred[temp], 30);
                 strncat(buf, ten[n/10], 30); 
             }
            else {
                strncat(buf, hundred[temp], 30);
                strncat(buf, ten[n/10], 30); 
                strncat(buf, one[n%10], 30);
            }
        }
        break;
    case 6:
        temp2 = n/1000;
        n -= (n/1000)*1000;
        
        temp = temp2/100;
        temp2 -=temp*100;
        
        if(temp2<20){
            sprintf(buf,"%s%s%s", hundred[temp], thouOne[temp2], thousand[temp2]);
        }
        else if(temp2 < 100)
        {
            if((temp%10)==0) sprintf(buf,"%s%s%s",hundred[temp], ten[temp2/10], thousand[temp2%10]);
            else sprintf(buf,"%s%s%s%s", hundred[temp],ten[temp2/10], thouOne[temp2%10], thousand[temp2%10]);
        }
        temp = n/100;
        n -= (n/100)*100;
        if(n < 20)
        {
            strncat(buf, hundred[temp], 30);
            strncat(buf, one[n], 30);
            
        }
        else if(n < 100)
        {
            if((n%10)==0){
                 strncat(buf, hundred[temp], 30);
                 strncat(buf, ten[n/10], 30); 
             }
            else {
                strncat(buf, hundred[temp], 30);
                strncat(buf, ten[n/10], 30); 
                strncat(buf, one[n%10], 30);
            }
        }
        break;
}
    
    
    return buf;

Building main.obj.
E:\v\2 \T++\T3 2\main.c(10): warning #2116: Local 'buf' is used but never assigned a value.
E:\v\2 \T++\T3 2\main.c(166): error #2001: Syntax error: found 'end of input' - expecting '}'.
*** Error code: 1 ***
Done.
 
: 00:19. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru