用if和for循环写一段linux的小程序.7,8行左右.该怎么写...

展开全部
收起
5回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 飞翔的企鹅

    17人对此回答表示赞同

    楼上的循环体改一改更简洁,一般情况下,应允许英文字母和其他字符混杂在字符串中:while(str[index] != '\0'){
    if(str[index] < 'a' || str[index] > 'z') continue;
    str[index] -= 32;
    index++;
    }
    展开
    17
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • 苯巴比妥

    14人对此回答表示赞同

    #include "Stdio.h"
    #include "string.h"int main(void)
    {

    char str[]="jocyeYIIE900";
    strupr(str) ;
    puts(str);
    }
    展开
    14
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • 李大莉

    13人对此回答表示赞同

    #include <stdio.h>
    #define LEN 20int main(void)
    {
    char str[LEN];
    printf("Input String.\n");
    scanf("%s",str); unsigned int index = 0;
    while(str[index] != '\0'){
    if(str[index
    展开
    13
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Jonathan

    4人对此回答表示赞同


    main()

    {

        char ch;

        scanf("%c",&ch);

        

        if((ch>='a')&&(ch<='z'))

        {

    展开
    4
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Eleanor

    1人对此回答表示赞同

    #include <stdio.h>
    #include <stdlib.h>int main(int argc,char* argv[])
    {
    int i;
    char dst[128],*pstr = argv[1];
    for(i=0;*pstr;i++)
    dst[i] = toupper(*pstr++);
    dst[i] = '\0';
    printf(&
    展开
    1
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部