Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- #include <ctype.h>
- void menu() {
- char R1 = ' ';
- char R2 = ' ';
- //int Xstart = 0; скорее всего здесь другой тип
- //int Xend = 0;
- //int deltaX = 0;
- int flag = 0;
- char radius = ' ';
- char k = ' ';
- printf("Laba №2, nomer variant\n");
- printf(" name/surname");
- while (1 == 1) {
- if (flag == 0) {
- printf("Input R1:\n");
- scanf_s("%c", &R1);
- fflush(stdin);
- if ((!isdigit(R1)) || (R1 <= 0)) {
- printf("Wrong input parameter, {Radius should be greater than zero and should be a digit}. Type ‘y’ for repeat, or any other for exit from application\n");
- system("pause");
- scanf_s("%c", &k);
- fflush(stdin);
- if (k == 'y') {
- flag = 1;
- continue;
- }
- else {
- flag = 0;
- continue;
- }
- }
- else{
- flag = 0;
- radius = atoi(&R1);
- }
- }
- }
- }
- int main(void) {
- menu();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement