Last active
November 10, 2015 20:40
-
-
Save norbekaiser/b2999b67bf35dd8b306b to your computer and use it in GitHub Desktop.
math body equations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void gleichung_c(int z_k); | |
void gleichung_d(int z_k); | |
int till; | |
int main(int argc,const char** argv[]){ | |
if(argc<2){ | |
printf("%s [number of steps], [body of numer]{, [body of numer]...}\n",argv[0]); | |
return 1; | |
} | |
till=atoi((char*)argv[1]); | |
for(int i=2;i<argc;i++){ | |
int z_k=atoi((char*)argv[i]); | |
gleichung_c(z_k); | |
gleichung_d(z_k); | |
} | |
return 0; | |
} | |
void gleichung_c(int z_k){ | |
printf("\n2 * x + 2 = 0\n"); | |
printf("\n-Koerper [%d]\n",z_k); | |
printf("\n--------------\n"); | |
for(int i=0;i<till;i++){ | |
printf("\t\t[%d]",i); | |
int val = (2 * i) + 2; | |
printf("--[%d]",val); | |
if((val%z_k)==0){ | |
printf("--Yep\n"); | |
} | |
else{ | |
printf("-Noep\n"); | |
} | |
} | |
} | |
void gleichung_d(int z_k){ | |
printf("\nx² + 2 * x = 0\n"); | |
printf("\n-Koerper [%d]\n",z_k); | |
printf("\n--------------\n"); | |
for(int i=0;i<till;i++){ | |
printf("\t\t[%d]",i); | |
int val = (i* i) + (2*i); | |
printf("--[%d]",val); | |
if((val%z_k)==0){ | |
printf("--Yep\n"); | |
} | |
else{ | |
printf("-Noep\n"); | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 * x + 2 = 0 | |
-Koerper [3] | |
-------------- | |
[0]--[2]-Noep | |
[1]--[4]-Noep | |
[2]--[6]--Yep | |
[3]--[8]-Noep | |
[4]--[10]-Noep | |
[5]--[12]--Yep | |
[6]--[14]-Noep | |
[7]--[16]-Noep | |
[8]--[18]--Yep | |
[9]--[20]-Noep | |
[10]--[22]-Noep | |
[11]--[24]--Yep | |
[12]--[26]-Noep | |
[13]--[28]-Noep | |
[14]--[30]--Yep | |
[15]--[32]-Noep | |
[16]--[34]-Noep | |
[17]--[36]--Yep | |
[18]--[38]-Noep | |
[19]--[40]-Noep | |
[20]--[42]--Yep | |
[21]--[44]-Noep | |
[22]--[46]-Noep | |
[23]--[48]--Yep | |
[24]--[50]-Noep | |
x² + 2 * x = 0 | |
-Koerper [3] | |
-------------- | |
[0]--[0]--Yep | |
[1]--[3]--Yep | |
[2]--[8]-Noep | |
[3]--[15]--Yep | |
[4]--[24]--Yep | |
[5]--[35]-Noep | |
[6]--[48]--Yep | |
[7]--[63]--Yep | |
[8]--[80]-Noep | |
[9]--[99]--Yep | |
[10]--[120]--Yep | |
[11]--[143]-Noep | |
[12]--[168]--Yep | |
[13]--[195]--Yep | |
[14]--[224]-Noep | |
[15]--[255]--Yep | |
[16]--[288]--Yep | |
[17]--[323]-Noep | |
[18]--[360]--Yep | |
[19]--[399]--Yep | |
[20]--[440]-Noep | |
[21]--[483]--Yep | |
[22]--[528]--Yep | |
[23]--[575]-Noep | |
[24]--[624]--Yep | |
2 * x + 2 = 0 | |
-Koerper [4] | |
-------------- | |
[0]--[2]-Noep | |
[1]--[4]--Yep | |
[2]--[6]-Noep | |
[3]--[8]--Yep | |
[4]--[10]-Noep | |
[5]--[12]--Yep | |
[6]--[14]-Noep | |
[7]--[16]--Yep | |
[8]--[18]-Noep | |
[9]--[20]--Yep | |
[10]--[22]-Noep | |
[11]--[24]--Yep | |
[12]--[26]-Noep | |
[13]--[28]--Yep | |
[14]--[30]-Noep | |
[15]--[32]--Yep | |
[16]--[34]-Noep | |
[17]--[36]--Yep | |
[18]--[38]-Noep | |
[19]--[40]--Yep | |
[20]--[42]-Noep | |
[21]--[44]--Yep | |
[22]--[46]-Noep | |
[23]--[48]--Yep | |
[24]--[50]-Noep | |
x² + 2 * x = 0 | |
-Koerper [4] | |
-------------- | |
[0]--[0]--Yep | |
[1]--[3]-Noep | |
[2]--[8]--Yep | |
[3]--[15]-Noep | |
[4]--[24]--Yep | |
[5]--[35]-Noep | |
[6]--[48]--Yep | |
[7]--[63]-Noep | |
[8]--[80]--Yep | |
[9]--[99]-Noep | |
[10]--[120]--Yep | |
[11]--[143]-Noep | |
[12]--[168]--Yep | |
[13]--[195]-Noep | |
[14]--[224]--Yep | |
[15]--[255]-Noep | |
[16]--[288]--Yep | |
[17]--[323]-Noep | |
[18]--[360]--Yep | |
[19]--[399]-Noep | |
[20]--[440]--Yep | |
[21]--[483]-Noep | |
[22]--[528]--Yep | |
[23]--[575]-Noep | |
[24]--[624]--Yep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment