ComboBox. Enter, Close. , . 7.1.
-:
//---------------------------------------------------------------------------
void __fastcall TForm1:: FormActivate (TObject *Sender)
{
Form1->ComboBox1->SetFocus(); // ComboBox 1
}
//---------------------------------------------------------------------------
void __fastcall TForm1:: ComboBox1KeyDown (TObject *Sender, WORD &Key,TShiftState Shift)
{
if (Key == 13) {
ComboBox1->Items->Add(ComboBox1->Text);
// ComboBox 1
ComboBox1->Text=""; //
}
}
//------------ --------------------
void __fastcall TForm1:: ComboBox1Click (TObject *Sender)
{
int n, i, nst;
nst = ComboBox1->ItemIndex; //
String st = ComboBox1->Items->Strings[nst]; // st
if (st[1]!= ' ') n = 1; // ' '
else n = 0;
for(i=1; i<st.Length(); i++) // st
if(st[i] == ' ' && st[i+1]!= ' ') n++;
Edit1->Text = IntToStr(n); // Edit 1
}
. 7.1
, gets (. .. 1).
main () :
#include <string.h>
void main()
{
int n, i, nst, len;
char st[81];
puts(" Input string ");
gets(st);
if (st[0]!= ' ') n = 1; // ' '
else n = 0;
len = strlen(st);
for(i=1; i<=len; i++) //
if(st[i] == ' ' && st[i+1]!= ' ') n++;
printf("\n Words = %d", n); //
puts("\nPress any key... ");
getch();
}
:
Edit ListBox ( Enter). Label. Close.
1. , , , .
2. , , .
3. , , .
|
|
4. , , .
5. , , .
6. , , , , , + , , .
7. , , , , , + , , .
8. , , , , , + , , .
9. , , . .
10. , , . .
11. , , . .
12. , , . , k - , k - , . k .
13. , , . , k , k - , . k .
14. , , . .
15. , , . .
16. .