سلام...کسی میتونه تو نوشتن این دوتا برنامه کمک کنه؟! به زبان C میخاستم ببینم چطور نوشته میشن...
من فقط در حد function, loop,array...بلدم (تازه کارم
)
Suppose you want to develop a program to play lottery. The program randomly generates a Lottery of a two-digit number, prompts the user to enter a two-digit number, and determines whether the user wins according to the following rule
If the user input matches the lottery in exact order , the awards is $10,000.
If the user input matches the lottery, the awards is $3,000.
If one digit in the user input matches a digit in the lottery, the awards is $1,000
Write a Complete program for the following specification
The SerialNumber class takes a serial number in the form of LLLLLLLLLLLL-DDDDDDDDD-LLLLLLLLL where each L is a letter and each D is a digit. The serial number has three groups
...of characters, separated by hyphen
Note: This time any number of letters followed by - followed by any number of digit followed by– followed by any number of letters
Example
String serial1= "GHFFFFFTRJ-8978888885-AQTTTTWR"; // Valid
String serial2 = "GHT7J-8975-AQWR"; // Invalid
String serial3 = "GHTRJ-8J75-AQWR"; // Invalid
String serial4 = "GHTRJ-8975-AQ2R"; // Invalid
سوال اول ...چطور یه برنامه بسازم که خودش راندوم یه عدد دو رقمی رو انتخاب کنه؟!
در مورد سوال دوم...به همون سادگی هست که فکر میکنم؟یه چیزی مثله اینی که نوشتم؟! فقط نمیدونم چطوری خط تیره بزارم وستشون!!!
"scanf("%c%c%c%c%c-%d%d%d%d%d-%c%c%c%c%c"،a,b,c.....)،"