lab9
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
#include "func.h"
|
||||
|
||||
int mainget(void){
|
||||
int t,x,y=0,num=0;
|
||||
int t=0,x,y=0,num=0;
|
||||
unsigned long input = 0;
|
||||
while(
|
||||
((x=getchar())>=32 && t<100)
|
||||
&& ((x>='a' && x<='z')
|
||||
|| (x>='0' && x<= '9')
|
||||
|| (x>='A' && x<='Z'))){
|
||||
// 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);
|
||||
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--;}
|
||||
if(t<0)t=0;
|
||||
@@ -25,7 +26,6 @@ int mainget(void){
|
||||
int help = 72697680;
|
||||
|
||||
int show = 83727987;
|
||||
int see = 836969;
|
||||
|
||||
int set = 836984;
|
||||
|
||||
@@ -51,8 +51,32 @@ int mainget(void){
|
||||
if(y==3&&(num>=10&&num<=21)) y = 300+num;
|
||||
|
||||
y=(input == show)?4:y;
|
||||
y=(input == see)?4:y;
|
||||
y=(input == 'C')?4:y;
|
||||
|
||||
|
||||
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++;
|
||||
}
|
||||
//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++;
|
||||
}
|
||||
if(*(buff+4)=='-')
|
||||
if(t==4)return 1;
|
||||
}
|
||||
t=0;
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user