Total score calculated by the Japanese flag

Source: Internet
Author: User
Tags border color

-(Void) drawrect :( cgrect) rect {

Cgcontextref context = uigraphicsgetcurrentcontext ();

// Start point (0, 0)

Cgcontextmovetopoint (context, 0, 0 );

// Draw the line to (100,100)

// Cgcontextaddlinetopoint (context, 100,100 );

Cgcontextaddrect (context, cgrectmake (100,100,200,100 ));

Cgcontextaddellipseinrect (context, cgrectmake (160,110, 80, 80 ));

Cgcontextmovetopoint (context, 100,200 );

Cgcontextaddlinetopoint (context, 100,350 );

// Draw a border

// Cgcontextstrokepath (context );

// Fill only

// Cgcontextfillpath (context );

// Set the fill color

[[Uicolor redcolor] setfill];

// [[Uicolor colorwithred: 1 Green: 1 Blue: 1 Alpha: 1] setfill];

//// Set the border color

// [[Uicolor bluecolor] setstroke];

[[Uicolor redcolor] set];

// Even-odd, fill in the parity rule

Cgcontextdrawpath (context, kcgpatheofillstroke );

//

//

// Cgcontextmovetopoint (context, 200,200 );

// Cgcontextaddarc (context, 100,200,100, 0, m_pi_2, 0 );

// Cgcontextaddlinetopoint (context, 0,100 );

//

/// Control Point

// Cgcontextaddcurvetopoint (context, 50, zero, 50,200,100,100 );

// Cgcontextaddquadcurvetopoint (context, 150, 0,200,100 );

Cgcontextstrokepath (context );

 

 

 

 

 

# Include <stdio. h>

 

 

Int sum1 (int * );

 

Int sum2 (int * A1, int * A2, int * A3 );

 

Int main (INT argc, const char * argv []) {

Int math [5] = {90,89, 78,68, 99 };

Int PHY [5] = {77,90, 88,67, 47 };

Int program [5] = {99,98, 97,90, 67 };

Int sum = 0;

For (INT I = 0; I <5; ++ I ){

Sum = math [I] + PHY [I] + program [I] + sum;

}

Printf ("sum: % d \ n", sum );

Printf ("average: % d \ n", sum/15 );

Printf ("summath: % d \ n", sum1 (math ));

Printf ("averagemath % d \ n", sum1 (math)/5 );

Printf ("sumphy: % d \ n", sum1 (PHY ));

Printf ("averagephy: % d \ n", sum1 (PHY)/5 );

Printf ("sumprogram: % d \ n", sum1 (Program ));

Printf ("averageprogram: % d \ n", sum1 (Program)/5 );

Printf ("sumstudent1: % d \ n", sum2 (& math [0], & PHY [0], & program [0]);

Printf ("averagestudent1: % d \ n", (sum2 (& math [0], & PHY [0], & program [0])/3 );

Printf ("sumstudent2: % d \ n", sum2 (& math [1], & PHY [1], & program [1]);

Printf ("averagestudent2: % d \ n", (sum2 (& math [1], & PHY [1], & program [1])/3 );

Printf ("sumstudent3: % d \ n", sum2 (& math [2], & PHY [2], & program [2]);

Printf ("averagestudent3: % d \ n", (sum2 (& math [2], & PHY [2], & program [2])/3 );

Printf ("sumstudent4: % d \ n", sum2 (& math [3], & PHY [3], & program [3]);

Printf ("averagestudent4: % d \ n", (sum2 (& math [3], & PHY [3], & program [3])/3 );

Printf ("sumstudent5: % d \ n", sum2 (& math [4], & PHY [4], & program [4]);

Printf ("averagestudent5: % d \ n", (sum2 (& math [4], & PHY [4], & program [4])/3 );

Return 0;

}

 

 

Int sum1 (int * ){

Int sum = 0;

For (INT I = 0; I <5; I ++ ){

Sum = A [I] + sum;

}

Return sum;

}

 

 

Int sum2 (int * A1, int * A2, int * A3 ){

Int sum = 0;

Sum = * A1 + * A2 + * A3;

Return sum;

}

Total score calculated by the Japanese flag

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.