字符升序排列怎么做?知道了升序降序自然不在话下,嘿嘿

将已经升序排好的字符串a和字符串b按升序归并到字符串c中并输出。 比如:please input string a: abcegiklnt please input string b: dfmopsyz abcdefgiklmnopstyz 开始代码: #include<stdio.h>#include<string.h>main(){ int i=0,j=0,k=0; char a[100],b[100],c[100],*p; printf("please input string a:\n"); scanf("%s",a); pri...
c语言代码 | 2011-05-16 22:20 | 阅读 995 次 | 评论 0 条

下面要写的几个代码都是与字符和字符串有关的。第一个:统计各个字符串的个数

#include<stdio.h> main() { int letters=0,numbers=0,space=0,others=0; /*先把字母,数字,空格,其他设为零*/ char ch; printf("please input some characters\n"); while((ch=getchar())!='\n') { if(ch>='a'&amp;&amp;ch<='z'||ch>='A'&amp;&amp;ch<='Z') letters++; ...
c语言代码 | 2011-05-15 22:58 | 阅读 797 次 | 评论 0 条

怎样用c语言绘制数学函数图线?(附解答)

下面用c语言绘制一条余弦图线: 绘制余弦图线用到了反余弦函数acos(),通过纵坐标的值来求出横坐标的值,确定了横坐标的值,其对称位置的横坐标的值就可以确定了,即用62减去确定的横坐标值,为什要用62呢,因为2∏*10是62的近似值。 #include<stdio.h>#include<math.h>main(){ double y; int x,m; for(y=1;y>=-1;y-=0.1) { m=acos(y)*10; for(x=1;x<m;x++) printf(" "); printf("*"); ...
c语言代码 | 2011-05-04 13:45 | 阅读 1701 次 | 评论 5 条
文章归档