Zhang Zhaoxing's Seventh time assignment

Source: Internet
Author: User

1. The first question on the enlarged strokes, difficult to parry Ah, it is difficult, and extracurricular knowledge involved in a lot of, just put on the first question, this is let us despite difficulties, tangled up two days is not covered, ask the classmate also checked the information, finally is out, not easy Ah, in order to show that really good difficult, on display three versions of good

#include <stdio.h>intMain () {inta[ -]={0}; Charzzh[ -]={        'Z','h','a','N','g','Z','h','a','o','h','a','N','g'    }; inti;  for(i=0;i< -; i++) A[zzh[i]-'a']++;  for(i=0;i< -; i++) printf ("%c:%d a \ n",'A'+I,a[i]); return 0;} 

This is the primary version, do not enter, is directly my name, haha is very humble, but this has been very laborious, and in fact, three versions have consulted the students, but I understand the extent of different

#include <stdio.h>intMain () {Charzzh[ -]; intmany[ -]={0},i,n,m; printf ("your name has several letters in pinyin:"); scanf ("%d",&N); printf ("Please enter your name pinyin, very sorry, this machine is a bit stupid, so please you a word each letter input, separated by a space oh: \ n");  for(i=0; i<n;i++) {scanf ("%c",&m); Zzh[i]=m; }     for(i=0; i<n;i++) Many[zzh[i]-'a']++;  for(i=0;i< -; i++) printf ("%c:%d a \ n",'A'+I,many[i]); return 0;} 

In fact, this is the last to play out, but I sorted out after their own ideas to play, which is considered to be those extracurricular things digested for me, although to play an empty letter, but it is spelled, some lack, but I am still relatively satisfied

#include <stdio.h>#include<string.h>intMain () {Charzzh[ -]; intlength,many[ -]={0},i; printf ("Enter the pinyin for the first name:"); scanf ("%s", Zzh); Length=strlen (ZZH);  for(i=0; i<length;i++) Many[zzh[i]-'a']++;  for(i=0;i< -; i++) printf ("%c:%d a \ n",'A'+I,many[i]); return 0;} 

This, it is very strong, and concise, and accurate, a start to ask the time is very laborious, but slowly still can understand.

It's hard, and I've learned a lot.

2.

#include <stdio.h>intMain () {intn,d; printf ("Please enter the value of N:"); scanf ("%d",&N); inta[Ten]; intb[Ten]; printf ("Please enter these numbers:"); inti;  for(i=0; i<n;i++) {scanf ("%d",&d); A[i]=D; } printf ("These numbers are reversed to:");  for(i=0; i<n;i++) {B[i]=a[n-i-1]; printf ("%d", B[i]); }    return 0;}

3.

#include <stdio.h>intMain () {intn,m,d,e,i,j; printf ("The first group has several numbers:"); scanf ("%d",&N); inta[Ten]; intb[Ten]; printf ("Please enter the first group number:");  for(i=0; i<n;i++) {scanf ("%d",&d); A[i]=D; } printf ("The second group has several numbers:"); scanf ("%d",&m); printf ("Please enter the number of the second group:");  for(i=0; i<m;i++) {scanf ("%d",&e); B[i]=e; } printf ("their common elements are:");  for(i=0; i<n;i++)         {              for(j=0; j<m;j++)                 {                     if(a[i]==B[j]) printf ("%d", A[i]); }         }        return 0;}

4.

#include <stdio.h>intOther (intN) {    if(n==0)        return 0; Else{printf ("%d", n%Ten); returnOther (n/Ten); }    }intMain () {intm; printf ("Please enter an integer (not 0):"); scanf ("%d",&m); printf ("output This number in reverse order:");    Other (m); return 0;}

Experience: Overall, this assignment, in addition to the second question, but the second problem because do the first problem of the brain is very chaotic, there have been a lot of mistakes, so each question has been stuck for a long time, the fourth question is not a good look at the beginning to do wrong, are very difficult, but on the first problem burning brain, homework once more difficult, challenge more and Come on!

Zhang Zhaoxing's Seventh time assignment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.