ISDIGIT [英] isdigit
问题描述
我可以帮助理解为什么我没有得到结果
我期待。
#include< stdio.h>
#include< ctype.h>
int main(){
int i,j,k,c;
i = 9;
c =''A'';
j = isdigit(9);
k = isdigit(''A' ');
printf(\ n \ n的值'\\''isdigit(%d)\"是%d",i,j);
printf(\ n和'\\''的值'\\''isdigit(''%c'')\"是%d \ n",c,k);
返回0;
}
输出:
isdigit(9)的值"是0
和'isdigit(''A'')的值是0
预期:
isdigit(9)的值是0
和'isdigit(''A'')的值是1
Could I get some help as to understanding why I am not getting a result
I expect.
#include <stdio.h>
#include <ctype.h>
int main (){
int i,j,k,c;
i=9;
c=''A'';
j=isdigit(9);
k=isdigit(''A'');
printf("\nThe value of \"isdigit(%d)\" is %d", i,j);
printf("\nAnd the value of \"isdigit(''%c'')\" is %d\n", c,k);
return 0;
}
Output:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 0
Expected:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 1
推荐答案
mdh写道:
mdh wrote:
我能得到一些吗?帮助理解为什么我没有得到结果
我期待。
#include< stdio.h>
#include< ctype.h>
int main(){
int i,j,k,c;
i = 9;
c =''A'';
j = isdigit(9);
k = isdigit(''A '');
printf(&\\; \'的值'\\''isdigit(%d)\"是%d",i,j);
printf(" \ n和'\\'和''的数字''是'(''%c'')\"是%d \ n",c,k);
返回0;
}
输出:
的值; ISDIGIT(9)"是0
和'isdigit(''A'')的值是0
预期:
isdigit(9)的值是0
和'isdigit(''A'')的值是1
Could I get some help as to understanding why I am not getting a result
I expect.
#include <stdio.h>
#include <ctype.h>
int main (){
int i,j,k,c;
i=9;
c=''A'';
j=isdigit(9);
k=isdigit(''A'');
printf("\nThe value of \"isdigit(%d)\" is %d", i,j);
printf("\nAnd the value of \"isdigit(''%c'')\" is %d\n", c,k);
return 0;
}
Output:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 0
Expected:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 1
'''''不是数字
9不是数字
''9''是一个数字
''A'' is not a digit
9 is not a digit
''9'' is a digit
10月6日下午2:02,mdh < m ... @ comcast.netwrote:
On Oct 6, 2:02 pm, "mdh" <m...@comcast.netwrote:
我可以帮助理解为什么我没有得到结果
我期待。
#include< stdio.h>
#include< ctype.h>
int main(){
int i,j,k,c;
i = 9;
c =''A'';
j = isdigit(9);
k = isdigit(''A'');
printf(" ; \ n \isdigit(%d)\的值是%d",i,j);
printf(" \ n和\的值\ ; isdigit(''%c'')\"是%d \ n",c,k);
返回0;
}输出:
isdigit(9)的值是0
和'isdigit(''A'')的值是0
预期:
isdigit(9)的值是0
和'isdigit(''A'')的值是1
Could I get some help as to understanding why I am not getting a result
I expect.
#include <stdio.h>
#include <ctype.h>
int main (){
int i,j,k,c;
i=9;
c=''A'';
j=isdigit(9);
k=isdigit(''A'');
printf("\nThe value of \"isdigit(%d)\" is %d", i,j);
printf("\nAnd the value of \"isdigit(''%c'')\" is %d\n", c,k);
return 0;
}Output:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 0
Expected:
The value of "isdigit(9)" is 0
And the value of "isdigit(''A'')" is 1
您认为A是十六进制数字吗?如果是这样,使用函数
isxdigit()而不是isdigit()。
Do you consider ''A'' as a hexadecimal digit? If so, use function
isxdigit() instead of isdigit().
''A''不是数字
9不是数字
''9''是数字
''A'' is not a digit
9 is not a digit
''9'' is a digit
它迟到了......谢谢
it''s getting late...thank you
这篇关于ISDIGIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!