The work of the C language delivered today

Source: Internet
Author: User

#include <stdio.h>
#define a 7
void raw_input (int r[]) {
int i;
Puts ("Please enter Integer");
for (i=0;i<a;i++) {
scanf ("%d", &r[i]);
}
}
void raw_output (int r[]) {
int i;
Puts ("The numbers of this ayyay includes");
for (i=0;i<a;i++) {
printf ("%d", r[i]);
}
printf ("\ n");
}
int summation (int r[]) {
int i,s;
s=0;
for (i=0;i<a;i++)
S=r[i]+s;
return (s);
}
void Sort_one (int r[]) {
int i,j,t,c;
for (j=1;j<a;j++) {
for (i=0;i<a-j;i++) {
if (R[i]<r[i+1]) {
T=R[I+1];
R[i+1]=r[i];
r[i]=t;
}
}
}
for (c=0;c<a;c++)
printf ("%d", r[c]);
}
void Sort_tow (int r[]) {
int i,j,t,k,c;
for (j=0;j<a-1;j++) {
K=j;
for (i=j+1;i<a;i++) {
if (R[k]<r[i])
K=i;
if (i!=k) {
T=r[i];
R[I]=R[K];
r[k]=t;
}
}
}
for (c=0;c<a;c++)
printf ("%d", r[c]);
}


int find_the_maxium (int r[]) {
int i,h,s;
s=0;
for (i=0;i<a-1;i++) {
if (r[i]<r[i+1])
s=i+1;
}
H=r[s];
return (h);
}
void find (int r[]) {
int e;
scanf ("%d", &e);
if (e<a)
printf ("%d\n", R[e]);
Else
Puts ("The number entered is outside the established range");
}
void Main () {
int Array[a],sum,max;
Raw_input (array);
Raw_output (array);
Sum=summation (array);
Puts ("The sun of the number in the array are equal to");
printf ("%d\n", sum);
Puts ("sort form largest to smallest");
Sort_one (array);
printf ("\ n");
Puts ("sort form smallest to largest");
Sort_tow (array);
printf ("\nthe maxium in the array is\n");
Max=find_the_maxium (array);
printf ("%d\n", Max);
Puts ("Think you Foy your use");
printf ("Inplease Enter a number less than%d\n", a);
Find (array);
}


The work of the C language delivered today

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.