#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)