Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/User-input-Text/C/user-input-text-1.c
Normal file
22
Task/User-input-Text/C/user-input-text-1.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Get a string from stdin
|
||||
char str[BUFSIZ];
|
||||
puts("Enter a string: ");
|
||||
fgets(str, sizeof(str), stdin);
|
||||
|
||||
// Get 75000 from stdin
|
||||
long num;
|
||||
char buf[BUFSIZ];
|
||||
do
|
||||
{
|
||||
puts("Enter 75000: ");
|
||||
fgets(buf, sizeof(buf), stdin);
|
||||
num = strtol(buf, NULL, 10);
|
||||
} while (num != 75000);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
25
Task/User-input-Text/C/user-input-text-2.c
Normal file
25
Task/User-input-Text/C/user-input-text-2.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <gadget/gadget.h>
|
||||
|
||||
LIB_GADGET_START
|
||||
|
||||
Main
|
||||
Cls;
|
||||
|
||||
String text;
|
||||
int number=0;
|
||||
|
||||
At 5,5; Print "Enter text : ";
|
||||
Atrow 7; Print "Enter ‘75000’: ";
|
||||
Atcol 20;
|
||||
|
||||
Atrow 5; Fn_let(text, Input ( text, 30 ) );
|
||||
Free secure text;
|
||||
|
||||
Atrow 7; Stack{
|
||||
while (number!=75000 )
|
||||
/*into stack, Input() not need var*/
|
||||
number = Str2int( Input ( NULL, 6 ) );
|
||||
}Stack_off;
|
||||
|
||||
Prnl;
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue