#include <stdio.h> int main(void) { -int sum=0,x; -do{ --printf("Enter Item price: "); --scanf("%d",&x); --sum += x; -}while(x!=0); -printf("Total= %d\\n",sum); -return 0; }
كيفية استخدام Do While في برمجة الألعاب
Problem statement
Ahmed was thinking about implementing a password checker (same as his laptop), but a much simpler program. Because he always forgets his passwords, so he saved 3 passwords on his laptop's password checker.
Ahmed's saved password:
- 1111
- 2222
- 3333
You will be given multiple lines, each line containing an N number (Ahmed's password). Check if the password matches Ahmed's 3 saved passwords, and terminate the program if the password is "Correct".
Input
Each of the following lines will contain the passwords N (1 ≤ N ≤ 10^4 ).
Output
Print "Incorrect" if the password is wrong, otherwise print "Correct".