lmao
This commit is contained in:
+28
-23
@@ -4,14 +4,14 @@ int mainget(void){
|
||||
int t=0,x,y=0,num=0;
|
||||
unsigned long input = 0;
|
||||
while(
|
||||
((x=getchar())>=32 && t<100)
|
||||
((x=getwchar())>=32 && t<100)
|
||||
&& ((x>='a' && x<='z')
|
||||
|| (x>='0' && x<= '9')
|
||||
|| (x>='A' && x<='Z'))){
|
||||
// printf("%d %lu ",x,input);
|
||||
//printf("%d %lu ",x,input);
|
||||
if(x>='a' && x<='z') {x -=('a'-'A');t--;}
|
||||
if(x>='A' && x<='Z') {input = (input*100)+(x);t--;}
|
||||
// printf("%d %lu\n",x,input);
|
||||
//printf("%d %lu\n",x,input);
|
||||
if(input>1000000000000000000){printf("input err\n\n");flush();input=0;t--;}
|
||||
if(x>='0' && x<='9'&&num<147483647){num = (num*10)+(x-'0');t--;}
|
||||
else if(num>147483647){printf("num is too big!\n\n");num = 0;t--;}
|
||||
@@ -19,7 +19,6 @@ int mainget(void){
|
||||
t++;
|
||||
if(end(x))return -1;
|
||||
}
|
||||
|
||||
if(end(x))return -1;
|
||||
|
||||
int exit = 69887384;
|
||||
@@ -56,27 +55,33 @@ int mainget(void){
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
int getsymb(int *b,wchar_t *buff){
|
||||
int t;
|
||||
*b=0;
|
||||
wchar_t x;
|
||||
while((x=getchar())!=end(x)&&x!='\n'&&x!=' '&&*b<5){
|
||||
if(x=='/n')x=' ';
|
||||
*(buff+*b) = x;
|
||||
*b++;
|
||||
int buffinput(int *cell, int *inbuff, int *buff){
|
||||
setlocale(LC_ALL, "");
|
||||
wint_t ch;
|
||||
*inbuff = 0;
|
||||
while((ch=getwchar())!='\n'&&*inbuff<5){
|
||||
*(buff+*inbuff)=(int)ch;
|
||||
(*inbuff)++;
|
||||
}
|
||||
//if(end(x)){flush();return -1;}
|
||||
|
||||
t=0;
|
||||
if(*buff=='-'){
|
||||
for(int i = 1; i<4;i++){
|
||||
if(*(buff+i)>='0'&&*(buff+i)<='9')t++;
|
||||
// -num- -select cell ----------------------------
|
||||
if(*buff == '-'){
|
||||
*cell = 0;
|
||||
for(int i = 1;i<(*inbuff);i++){
|
||||
if( *(buff+i) >= '0' && *(buff+i) <= '9'){
|
||||
*cell = ((*cell)*10) + ((*(buff+i))- '0');
|
||||
if(*cell>99){*cell=0;}}
|
||||
else if (*(buff+i)!='-') {*cell = 0;break;}
|
||||
}
|
||||
if(*(buff+4)=='-')
|
||||
if(t==4)return 1;
|
||||
}
|
||||
t=0;
|
||||
getchar();
|
||||
if(*(buff+(*inbuff-1))=='-'&&*cell>-1)return 1;
|
||||
//-------------------------------------------------
|
||||
|
||||
// exit -------------------------------------------
|
||||
if (*buff =='e'&&
|
||||
*(buff+1)=='x'&&
|
||||
*(buff+2)=='i'&&
|
||||
*(buff+3)=='t'){return -1;}
|
||||
//-------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user