Zhong 160809323 (Assignment 7)

Source: Internet
Author: User

#include <stdio.h>//write a recursive function to output an integer in reverse orderintMain () {inti,n,a[5]; printf ("enter the value for n: \ N"); scanf ("%d",&N); printf ("each number of integers is separated by a space, and an integer of n digits is entered: \ n", N);  for(i=0; i<n; i++) {scanf ("%d",&A[i]); } printf ("output is: \ n") ;  for(i=n-1; i>-1; i--) {printf ("%d", A[i]); } return 0; }
#include <stdio.h>//find common elements for a given two array of integral typesintMain () {inti,j,n,m,a[5],b[5]; printf ("each input integer must be separated by a space, or an error may occur \ n"); printf ("Enter values for n and m: \ N"); scanf ("%d\n",&N); printf ("Enter n integers, respectively: \ N", N); scanf ("%d\n",&m); printf ("Please enter an M integer separately: \ n", M);  for(i=0; i<n;i++) {scanf ("%d",&A[i]); }         for(i=0; i<m;i++) {scanf ("%d",&B[i]); }             for(i=0; i<n;i++)     {          for(j=0; j<n;j++)         {             if(a[i]==B[j]) printf ("%d", A[i]); }                }                    return 0; } 
#include <stdio.h>//The program calculates the number of each letter in its name that contains the alphabet.#include <string.h>intMain () {Charname[0]; intlength,i,a[ -]={0}; printf ("Enter your own name pinyin:"); scanf ("%s", name); Length=strlen (name);  for(i=0; i<length;i++) {A[name[i]-'a']++; }             for(i=0;i< -; i++) {printf ("%c:%d a \ n",'A'+I,a[i]); }            return 0;}

The above question at the beginning I do not, is to read the code of Fengqingyang classmate and then I knocked out

#include <stdio.h>//array in reverse order, sequential outputintMain () {intI, n,a[5]; printf ("enter the value of N (n<10):"); scanf ("%d",&N); printf ("each input integer must be separated by a space, or an error may occur \ n"); printf ("Enter n integers, respectively: \ N");  for(i=0; i<n;i++) {scanf ("%d",&A[i]); }            for(i=n-1; i>-1; i--) {printf ("%d", A[i]); }                return 0; } 

Zhong 160809323 (Assignment 7)

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.