爱问知识人 爱问教育 医院库

满分求解五道c 题(2)

首页

满分求解五道c++题(2)

6.编写一个程序,主函数中定义并输入字符串,调用子函数,将字符串中字符按正(逆)序排列,主函数中输出结果。
7.编写一个程序,主函数中定义并输入字符串,分别调用子函数(自定义),统计(0-9)数值的个数、(a-z、A-Z)字符的个数、空格的个数,主函数中输出结果。
8.编写一个程序,主函数中定义并输入二个字符串,调用子函数(自定义),比较二个字符串的大小,主函数中输出结果。
9.编写一个程序,主函数中定义二个字符数组(或字符串),输入其中一个字符串,调用子函数(自定义),实现字符串的拷贝,主函数中输出结果。
10.编写一个程序,主函数中定义并一个输入字符串,调用子函数(自定义)统计字符串中的字符实际个数,主函数中输出结果。

提交回答
好评回答
  • 2009-05-17 16:35:51
      #include  
    #include  
    using namespace std; 
    第1题: 
    char * strtolwr(char *str) 
    { 
    assert(str != NULL); 
    char *tmp = str; 
    while(*str) 
    { 
    if(*str >= 'A' && *str >str; 
    strtolwr(str); 
    cout= 'a' && *str >str; 
    strtoupr(str); 
    cout>str; 
    cout>ch; 
    int res = findchar(str, ch); 
    if(res == 0) 
    { 
    cout>longstr; 
    cout>shortstr; 
    char *tmp; 
    char *tmplong = longstr; 
    int count = 0; 
    cout>str1; 
    cout>str2; 
    catstr(str1, str2); 
    cout<  

    小***

    2009-05-17 16:35:51

其他答案

    2009-05-17 16:41:50
  •   #include 
    #include 
    using namespace std;
    第6题:
    void orderstr(char *str)
    {
    	assert(str != NULL);
    	int i,j,k;
    	int len = strlen(str);
    	char tmp;
    	for(i=0; i str[j])
    			{
    				k = j;
    			}
    		}
    		if(k != i)
    		{
    			tmp = str[i];
    			str[i] = str[k];
    			str[k] = tmp;
    		}
    	}
    }
    void main()
    {
    	char str[100];
    	cout>str;
    	orderstr(str);
    	cout= '0' && *str = 'a' && *str = 'A' && *str  *str2)
    		{
    			return 1;
    		}
    		else if (*str1 == *str2)
    		{
    			str1++;
    			str2++;
    		}
    		else
    		{
    			return -1;
    		}
    	}
    	if(*str1 == '\0' && *str2 != '\0')
    	{
    		return -1;
    	}
    	else if(*str1 != '\0' && *str2 == '\0')
    	{
    		return 1;
    	}
    	else
    	{
    		return 0;
    	}
    }
    void main()
    {
    	char str1[100];
    	char str2[100];
    	cout>str1;
    	cout>str2;
    	int res = cmpstr(str1, str2);
    	if(res == -1)
    	{
    		cout str2">strSrc;
    	cpystr(strDest, strSrc);
    	cout>str;
    	int count = strSize(str);
    	cout<<"字符个数:"<  

    臣***

    2009-05-17 16:41:50

  • 2009-05-17 13:50:29
  • 说的这么详细,为什么要别人设计

    透***

    2009-05-17 13:50:29

类似问题

换一换
  • C/C++ 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 174-193
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):