- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
printf("Enter item code: "); //Prompts user
scanf ("%14s", codenew1); //Read user input
len = strlen(codenew1); //Read each character into variable len
while (len != strspn(codenew1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
{
printf ("Name contains non-alphabet characters. Try again!: "); //Prompts user to try again
scanf ("%14s", codenew1); //Reads user input
len = strlen(codenew1); //Read each character into variable len
} //Endwhile
strncpy(codenew, codenew1,2); //Copy the first two characters from the variable codenew1
codenew[2] = 0; //Store first two characters into variavle codenew
for ( j = 0; j < num_items; j++) //Loop for num_items times
{ //Beginning of for loop
if (strcmp(array[j].code1, codenew) == 0) //If codenew is found in file
{ //Beginning of if statement
price[i] = item_qty[i] * array[j].price1; //Calculating the price of an item
printf("Price : %d", price[i]); //Prints price
printf("\nEnter '%s' to confirm: ", array[j].itemname1); //Confirming the item
scanf("%19s", item_name1[i]);
while (strcmp(item_name1[i], array[j].itemname1 )!=0) //Looping until both item names are the same
{ //Begin while loop
printf("Item name is not %s ,Try Again!: ", array[j].itemname1); //Prompt user to try again
scanf ("%19s", item_name1[i]); //Reads item name into an array
len = strlen(item_name1[i]); //Reads each character into variable len
} //End while loop
len = strlen(item_name1[i]); //Read each character into variable len
while (len != strspn(item_name1[i], "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) //While len contains non alphabetic characters
{ //Beginning while
printf ("Name contains non-alphabet characters. Try again!: "); //Prompts user to try again
scanf ("%19s", item_name1[i]); //Read user input
len = strlen(item_name1[i]); //Read each character into variable len
} //End while
strncpy(item_name[i], item_name1[i], 20); //Copy the first two characters from the variable codenew1
item_name[i][20] = 0; //Store first 20 characters in variable item_name[i]
total_price+= price[i]; //Calculate total price
break; //Terminates loop
} //End of if statement
else
if (strcmp(array[j].code1, codenew) != 0) //If codenew is found in file
{
printf("Invalid input! Try again.");
goto Here;
}
} //End of for loop
wvxvw 14.03.2015 23:40 # +2
bormand 14.03.2015 23:52 # +4
Xom94ok 15.03.2015 01:03 # 0
kegdan 15.03.2015 02:18 # +1
laMer007 15.03.2015 02:24 # 0
3.14159265 15.03.2015 02:57 # 0
bormand 15.03.2015 07:01 # 0
absolut 15.03.2015 10:30 # 0
kegdan 15.03.2015 10:41 # 0
имбанутый сериал - сначала сценаристам кололи хороший, годный героин, и в первых 2 сезонах был сюжет - АХТЫЖЕБАНЫЙТЫНАХУЙ! А потом героин кончился и началось уныние. Эпичен тем, что в в последних сезонах фактически не раскрываются загадки унд тайны появившиеся в ранних сезонах
laMer007 15.03.2015 11:42 # 0
absolut 15.03.2015 12:07 # 0
laMer007 15.03.2015 13:14 # 0
kegdan 15.03.2015 13:44 # 0
универсальный ответ
laMer007 15.03.2015 13:58 # 0
absolut 15.03.2015 14:09 # 0
laMer007 15.03.2015 14:17 # 0
kegdan 15.03.2015 14:22 # 0
laMer007 15.03.2015 14:47 # 0
guest 14.11.2015 14:25 # 0
guest 20.11.2015 07:32 # 0
guest 24.11.2015 09:41 # 0
guest 14.11.2015 15:15 # 0
guest 20.11.2015 07:35 # 0
guest 20.11.2015 15:08 # 0
guest 24.11.2015 09:43 # 0
3.14159265 15.03.2015 00:49 # +6
-Wmaximum-pedantic или -Wperfectio
который будет пиздеть, если форматирование сползло или какая-то строчка непрокомментирована.
1024-- 15.03.2015 10:45 # +2
kegdan 15.03.2015 10:54 # −2
laMer007 15.03.2015 11:43 # +1
-Цевроппа
movaxbx 15.03.2015 17:38 # +1
kegdan 15.03.2015 17:44 # +2
movaxbx 15.03.2015 23:23 # +1
dxd 16.03.2015 15:59 # 0
1024-- 16.03.2015 16:21 # +4