C language of the second week

Source: Internet
Author: User

Like a nightmare C language is over. Yes, the process is no less than the feeling of childbirth in a pregnant woman, extremely miserable. There is no code base at all I even forget a lot of math thinking. Here again to thank Xiao Teacher for my care, although he is our teacher, but the posture is very low, like a public servant. I seemed to see a different luster in his young face. It says "Hengmeilengdui cold on the thousand fingers, bow willing ox." "This kind of luster makes me more and more feel his kind kindness, in the heart that respect also grows thicker."

Master leads the door and the practice depends on the individual. Make a copy of the code to commemorate this Binghuangmaluan learning phase.

#include <stdio.h>

int stringcmp (char A[],char b[]);
int GetLength (char arr[]);
void sort (int arr[]);


Double Getarea (float l,float k);
int Getarea (int l,int k);


int main ()
{
/*
Char arr[20];
scanf ("%s", arr);

int re = GetLength (arr);
printf ("%d", re);

int length,width;
scanf ("%d");
Getarea (5,6);

int result = STRINGCMP (arr, "abcea");
if (result>0)
{
printf ("1>2\n");
}else if (result<0)
{
printf ("1<2\n");
}
else{
printf ("1==2\n");
}

int i=0;
int arr[] = {5,1,9,4,6,8,7,0,2,3};
printf ("Before sorting:");
for (i=0;i<10;i++)
{
printf ("%d", arr[i]);
}



Sort (arr);


printf ("After sorting:");

for (i=0;i<10;i++)
{
printf ("%d", arr[i]);
}
*/


printf ("%4.3lf", Getarea (float) 3.2, (float) 5.6));

printf ("Asdfasdf");
printf ("%20d", 100);




}


int stringcmp (char A[],char b[])
{
int i=0;
while (2)
{
if (a[i]== ' && b[i]== ')
{
return 0;
}
else if (a[i]== ' &&b[i]!= ')
{
return-1;
}
else if (b[i]== ')
{
return 1;
}



if (a[i]-b[i]!=0)
{
return a[i]-b[i];
}
i++;
}

return 0;
}


int GetLength (char arr[])
{
int count=0;
int i=0;
while (arr[i]!= ')
{
count++;
i++;
}
return count;
}


int Getarea (int l,int k)
{
return l*k;
}


Double Getarea (float l,float k)
{
return l*k;
}


void sort (int arr[])
{
int i=0;
/*
for (i=0;i<10;i++)
{
Int J;
for (j=0;j<9;j++)
{
if (arr[j]>arr[j+1])
{
int temp = Arr[j];
ARR[J] = arr[j+1];
ARR[J+1] = temp;
}
}
}*/

for (i=0;i<9;i++)
{
Int J;
for (j=i;j<10;j++)
{
if (Arr[i]>arr[j])
{
int temp = Arr[i];
Arr[i] = Arr[j];
ARR[J] = temp;
}
}
}
}


C language of the second week

Related Article

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.