Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
My program#include<stdio.h> int Is_even(int n) { if(n % 2 == 0) return 1; else return 0; } int main() { int coordinates[100][2], number; scanf("%d", &number); while(number-- > 0) { scanf("%d%d", &coordinates[number][0], &coordinates[number][1]); // printf("%d%d", coordinates[number][0], coordinates[number][1]); if(Is_even(coordinates[number][0]) == 1 && Is_even(coordinates[number][1]) == 1) printf("%d\n", coordinates[number][0] + coordinates[number][1]); else if(Is_even(coordinates[number][0]) == 0 && Is_even(coordinates[number][1]) == 0) printf("%d\n", coordinates[number][0] + coordinates[number][1] - 1); else printf("No Number\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator