zoukankan      html  css  js  c++  java
  • 160809307 张浩飞(7)

    #include<stdio.h>
    int main() //你的名字
    {
        int cnt[52]={0};
        char name;
        printf("请输入你的英文名字(注意首字母大写)。并以.结束!
    ") ;
         printf("你的名字:");
        int i;
        do
    { 
        scanf("%c",&name);
         if(name>='A' && name<'Z') cnt[name-'A']++;
         if(name>='a' && name<'z') cnt[26+name-'a']++;  
    }    
        while(name!='.');
        for(i=0;i<26;i++)
    {  
        printf("%c     %d
    ",'A'+i,cnt[i]);
    }
     
         for(i=0;i<26;i++)
    {
        printf("%c     %d
    ",'a'+i,cnt[26+i]);
    }
        return 0;
    }
    #include <stdio.h>
    int main() //倒序输出
    {
        int a[6],temp;
        int *p,*q;
        printf("请输入六个整数,中间用空格隔开:");
        for(p=a;p<a+6;p++)
        scanf("%d",p);
        for(p=a,q=a+5;p<q;p++,q--)
    {
          temp=*p;
          *p=*q;
          *q=temp;
    }
          printf("倒序输出六个整数为:");
          for(p=a;p<a+6;p++)
          printf("%d ",*p);
        return 0;
    }
  • 相关阅读:
    String、StringBuilder、StringBuffer区别
    深拷贝和浅拷贝
    二叉查找树(一)
    二叉树的遍历
    二叉树
    递归
    队列

    数据结构基础
    视图
  • 原文地址:https://www.cnblogs.com/zhf-9747/p/6052849.html
Copyright © 2011-2022 走看看