Mistři v programování na #hovnokod

Úlohou študenta bolo načítať 3 veľkosti strán trojuholníka, overiť či sa z takýchto strán dá zostrojiť trojuholník a ak áno, vypočítať jeho obvod.

#include <stdio.h>
#include <stdlib.h>

int main()
{   int a,b,c,d;
    printf("zadaj cislo a:\n");
    scanf ("%d",&a);
    printf("zadaj cislo b:\n");
    scanf ("%d",&b);
    printf("zadaj cislo c:\n");
    scanf ("%d",&c);

      if (c=a+b)
    {
           d=a+b+c;
           printf("obvod trojholnika je:%d.",d);
    }
      else
           printf("z tyhto cisel nemoze byt trojuholnik\n");
    return 0;
}

Anonymous,

Nazvoslovie: favs ~ favorites, songJson ~ songId, replace ~ removeIfExists, isAvailable ~ wasRemoved

private boolean addFavs(String songJson, boolean replace) {
Set<String> favs = getFavs();
boolean isAvailable = false;
if(!favs.contains(songJson)) {
    favs.add(songJson);
} else {
    if(replace) {
         favs.remove(songJson);
         isAvailable = true;
    }
}
// ...
}

Anonymous,


Anonymous,

read it

int main(){
	const double degToRad = 3.14159265358979323846 / 180.00;
	Vertex A,B,C;
	A = init(A);
	B = init(B);
	C = init(C);
	scanf("%lf %lf %lf %lf %lf %lf", &A.x, &A.y, &A.angle, &B.x, &B.y, &B.angle);
	if(inputIsInvalid(A,B)){
		printf("-1\n");
		return 0;
	}
	C.angle = 180.00 - A.angle - B.angle;
	C.side = sqrt(pow(B.x - A.x, 2)+pow(B.y - A.y,2));
	B.side = (sin(B.angle * degToRad) * C.side)/(sin(C.angle * degToRad));
	A.side = (sin(A.angle * degToRad) * C.side)/(sin(C.angle * degToRad));
	double height = B.side * sin(A.angle * degToRad);
	double* x = (double*) malloc(2*sizeof(double));
	double* y = (double*) malloc(2*sizeof(double));
	calculateRootX(A,B,C,x);
	calculateRootY(A,B,C,x,y);
	if(*y > *(y+1)){
		C.x = *x;
		C.y = *y;
	}else{
		C.x = *(x+1);
		C.y = *(y+1);
	}
	printf("%.2lf %.2lf %.2lf\n", height, C.x, C.y);
	return 0;
}

Anonymous,

Takto vypadá IT v režii státní správy...

public enum anoNeType 
{
    ano = 1,
    ne = 2
}

Anonymous,