比较数组的大小.分别比较两个数组对应元素的大小,若a数组大于b数组对应元素的个数最多,则a>b,并统计两组大于、等于、小于的个数.
用C语言写
人气:466 ℃ 时间:2019-08-18 15:52:30
解答
#include
#include
#define MAX 200
void main()
{
\x09char a[MAX],b[MAX];
\x09scanf("%s %s",a,b);
\x09int l1 = strlen( a );
\x09int l2 = strlen( b );
\x09if( l1 > l2 )
\x09\x09printf("a>b and the number is %d\n",l1-l2);
\x09else if( l1 < l2 )
\x09\x09printf("a
推荐
猜你喜欢
- 根号-125分之1的立方根
- 高中数学求y=arccos(x^2-2)的单调递增区间
- 一辆小汽车,轮胎外直径是8厘米,每分钟转300周,1小时行驶多少千米?
- (生物)下列有关人类基因组计划的描述中,不正确的是( )
- 把4米长的铁丝平均分成5段,每段长用分数表示( )米用小数表示( )米.每段长是1米的( ),是全长的(
- 翻译中文:As a boy,he often went skating in winter.what's the weather like?
- 瑞士中学老师巴尔末成功地从光谱数据9/5,16/12,25/21,.按着规律,第七个式子是什么?第n个呢?
- 已知函数f(x)=x的平方/ax b(a.b为常数)且方程f(x)=x-12有两个实根为3和4,(1)求f