Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

krkris / Loogikafunktsioon

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit d4c5fe7a authored 3 years ago by erfeld's avatar erfeld
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Update Kood.c

parent 47231ee5 master
Hide whitespace changes
Inline Side-by-side
Showing with 23 additions and 14 deletions
  • Kood.c
Kood.c
View file @ d4c5fe7a
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
int main(void){ int sisestus(const char[], char[], char[], char[], char[]);
char a[20], b[20], c[20], d[20];
printf("Sisestage 4x4 Karnaugh kaart või 16 loogikaväärtust: \n");
scanf("%s", a);
if(strlen(a) == 4){ int main(void){
char a[20], b[20], c[20], d[20];
int x;
x = sisestus("Sisestage 4x4 Karnaugh kaart või 16 loogikaväärtust: \n", a, b, c, d);
if (x == 1){
return 1;
}
return 0;
}
int sisestus(const char tekst[40], char a[20], char b[20], char c[20], char d[20]){
printf("%s", tekst);
scanf("%s", a);
if(strlen(a) == 4){
printf("Sisestage teine rida \n"); printf("Sisestage teine rida \n");
scanf("%s", b); scanf("%s", b);
if (strlen(b) != 4){ if (strlen(b) != 4){
printf("Vale!"); printf("Vale!");
return 0;
} }
printf("Sisestage kolmas rida \n"); printf("Sisestage kolmas rida \n");
scanf("%s", c); scanf("%s", c);
if (strlen(c) != 4){ if (strlen(c) != 4){
printf("Vale!"); printf("Vale!");
return 0;
} }
printf("Sisestage neljas rida \n"); printf("Sisestage neljas rida \n");
scanf("%s", d); scanf("%s", d);
if (strlen(d) != 4){ if (strlen(d) != 4){
printf("Vale!"); printf("Vale!");
return 0;
} }
} }
else if (strlen(a) == 16){
return 0;
}
else{ else{
printf("Vale!"); printf("Vale!");
return 1;
} }
return 0;
} }
\ No newline at end of file
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment