Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Spring 2017 Lab 5 v1
//gcc 5.4.0 #include <stdio.h> int main(void) { int a; int b; int c; int x; scanf("%d %d %d",&a,&b,&c); // printf("%d\n%d\n%d\n",a,b,c); if(a==b&&b==c) x=0; if((a==b&&b!=c)||(b==c&&a!=b)||(a==c&&b!=c)) x=1; if(a!=b&&b!=c&&c!=a) x=2; if((a==0)||(b==0)||(c==0)) x=3; if((a<0)||(b<0)||(c<0)) x=3; if((c>=a+b)||(a>=c+b)||(b>=a+c)) x=4; // if((isspace(a)||(isspace(b)||isspace(c)) // printf("%d\n",x); switch(x){ case 0: printf("The triangle is equilateral"); break; case 1: printf("The Triangle is isoceles"); break; case 2: printf("The Triangle is scalene"); break; case 3: printf("Those values aren't correct"); break; case 4: printf("That shape isn't a triangle"); break; } }
run
|
edit
|
history
|
help
0
la wea afortunada
Area & Perimeter of Circle
If Statement/ Decrement practice
First program.c
Simple Calculator v1.0
bitwise manipulation
GCC supports 128-bit integer arithmetic
test
Max of arrays
MATRICES DE CADENAS CON PUNTEROS