Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 16.10 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. //  printf("Funktioniert!\n");
  5.  
  6. char marscalc(int argc, char *argv[]);
  7. int digit_laenge (char *digit);
  8. int alloc_laenge_1(char *argv[]);
  9. void alloc_cpy(char *argv[],char *digit);
  10. int alloc_laenge_2(char *argv[]);
  11. void alloc_cpy2(char *argv[],char *digit);
  12. char vorzeichen_schiebung(char *digit);
  13. char null_move (char *result);
  14. char null_fueller(char *digit1, char *digit2);
  15. char addition(char *digit1, char *digit2);
  16. char subtraktion(char *digit1, char *digit2);
  17.  
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21.     marscalc(argc,argv);
  22.     return 0;
  23. }
  24.  
  25. char marscalc(int argc, char *argv[])
  26. {
  27.   (void) argc;  //argc wird nie benutzt deshalb void damit der Upload funktioniert.
  28.   int c = alloc_laenge_1(argv);
  29.   char *digit1 = (char *)malloc(c * sizeof(char));
  30.   alloc_cpy(argv,digit1);
  31.  
  32.   int d = alloc_laenge_2(argv);
  33.   char *digit2 = (char *)malloc(d * sizeof(char));
  34.   alloc_cpy2(argv,digit2);
  35.  
  36.  
  37.   char op = argv[2][0];
  38.   if(digit1[0] == '+' || digit1[0] == '-')
  39.   vorzeichen_schiebung(digit1);
  40.   if(digit2[0] == '+' || digit2[0] == '-')
  41.   vorzeichen_schiebung(digit2);
  42.  
  43.   printf("Number: %s\n", digit1);
  44.   printf("Number: %c\n", op);
  45.   printf("Number: %s\n", digit2);
  46.  
  47.  
  48.   null_move(digit1);
  49.   null_move(digit2);
  50.   null_fueller(digit1,digit2);
  51.   if(op == '+')
  52.   addition(digit1,digit2);
  53.   if(op == '-')
  54.   subtraktion(digit1,digit2);
  55.   free(digit1);
  56.   free(digit2);
  57.   return 0;
  58. }
  59.  
  60. int digit_laenge (char *digit)
  61. {
  62. int i = 0;
  63.    for(; digit[i] != '\0'; i++){
  64.    }
  65. return i;
  66. }
  67.  
  68. int alloc_laenge_1(char *argv[]){
  69. int i = 0;
  70.     for(i = 0;argv[1][i] != '\0'; i++ ){
  71.     }
  72. return i+1;
  73. }
  74.  
  75.  
  76. int alloc_laenge_2(char *argv[]){
  77. int i = 0;
  78.     for(i = 0;argv[3][i] != '\0'; i++ ){
  79.     }
  80. return i+1;
  81. }
  82.  
  83. void alloc_cpy(char *argv[],char *digit){
  84. int i = 0;
  85.     for(i = 0;argv[1][i] != '\0'; i++ ){
  86.            digit[i] = argv[1][i];
  87.     }
  88.      digit[i+1] = '\0';
  89. }
  90.  
  91.  
  92. void alloc_cpy2(char *argv[],char *digit){
  93. int i = 0;
  94.     for(i = 0;argv[3][i] != '\0'; i++ ){
  95.            digit[i] = argv[3][i];
  96.     }
  97.      digit[i+1] = '\0';
  98. }
  99.  
  100.  
  101. char vorzeichen_schiebung(char *digit)
  102. {
  103.     for(int i = 0; digit[i] != '\0';i++){
  104.         digit[i] = digit[i+1];
  105.     }
  106.  
  107.     return *digit;
  108. }
  109.  
  110.  
  111. char null_move (char *result)
  112. {
  113. int laenge = digit_laenge(result);
  114. int vorne_ja = 0;
  115. int vorne_nulls = 0;
  116. int hinten_nulls = 0;
  117. int komma_ja = 0;
  118. int komma = 0;
  119.  
  120.     for(int i = 0; result[i] == '0' || result[i] == ',' || result[i] == '\0'; i++){
  121.     if(result[i] == '\0'){
  122.         result[0] = '0';
  123.         result[1] = '\0';
  124.         printf("result lautet in nullmove: %s\n", result);
  125.     return *result;}
  126.  
  127.     }
  128.  
  129.     for(int i = 0; result[i] == '0'; i++){ // sobald vor dem komma nur 0en sind , komma_ja = 1
  130.         if(result[i+1] == ','){
  131.             komma_ja = 1;
  132.         }
  133.         if(i == laenge){
  134.         break;
  135.         }
  136.     }
  137.  
  138.  
  139.     for(int i = 0; result[i] != ',';i++){ // sobald irgendein komma gefunden wird
  140.            if(result[i+1] == ','){
  141.             komma = 1;
  142.         }
  143.         if(i == laenge){
  144.         break;
  145.         }
  146.     }
  147.  
  148.  
  149.  
  150.     if(result[0] == '0'){ // vorne nullen zählen
  151.         vorne_ja = 1;
  152.         for(int i = 0; result[i] == '0'; i++){
  153.         vorne_nulls = i+1;}
  154.     }
  155.  
  156.     if(result[laenge-1] == '0'){ // hinten nullen zählen
  157.         for(int i = laenge-1; result[i] == '0'; i--){
  158.         hinten_nulls = laenge - i;}
  159.     }
  160.  
  161.     if(komma_ja == 1){
  162.         vorne_nulls =  vorne_nulls - 1;
  163.     }
  164.  
  165.     int zahl = laenge - vorne_nulls - hinten_nulls;
  166.  
  167.       if(komma == 0)
  168.     zahl = laenge - vorne_nulls;
  169.  
  170.     int null_ter = zahl ;
  171.  
  172.     if (vorne_ja == 1){
  173.         for(int i = 0; i != zahl; i++){
  174.             result[i] = result[i+vorne_nulls];
  175.         }
  176.     }
  177.  
  178.     result[null_ter] = '\0';
  179.  
  180.  if (result[0] == '0' && result[1] == ',' && result[2] == '\0')
  181.         result[1] = '\0';
  182.  
  183.  laenge = digit_laenge(result);
  184.  if(result[laenge-1] == ',')
  185.     result[laenge-1] = '\0';
  186.  
  187.  
  188.   /* printf("komma_pos lautet in nullmove: %d\n", komma_pos);
  189.     printf("laenge lautet in nullmove: %d\n", laenge);
  190.     printf("zahl lautet in nullmove: %d\n", zahl);
  191.     printf("vorne_ja lautet in nullmove: %d\n", vorne_ja);
  192.     printf("vorne_nulls lautet in nullmove: %d\n", vorne_nulls);
  193.     printf("hinten_nulls lautet in nullmove: %d\n", hinten_nulls);
  194.     -0034,34237600 + -001282,1100
  195.     */
  196.     printf("result lautet in nullmove: %s\n", result);
  197. return 0;
  198. }
  199.  
  200.  
  201. char null_fueller(char *digit1, char *digit2)
  202. {
  203. int vorkommazahlen_digit1 = 0;
  204. int vorkommazahlen_digit2 = 0;
  205. int gros_vorkommazahl = 0;
  206. int gros_nachkommazahl = 0;
  207. int nachkommazahlen_digit1 = 0;
  208. int nachkommazahlen_digit2 = 0;
  209. int komma_ja_1 = 0;
  210. int komma_ja_2 = 0;
  211. int komma_pos_1 = 0;
  212. int komma_pos_2 = 0;
  213. int komma_end = 0;
  214. int speicher = 0;
  215.  
  216.  
  217.     for(int i = 0; digit1[i] != ','; i++ ){ // zählt bis zum komma, +1 weil es bei 0 anfängt -34,342376 + -1282,11
  218.         vorkommazahlen_digit1 = i+1; // +1 weil sonst eine stelle fehlt
  219.         if(digit1[i] == '\0'){
  220.         vorkommazahlen_digit1 -=1; // für den fall dass eine zahl ohne komma kommt
  221.         break;}           // zb. 34
  222.  
  223.     }
  224.  
  225.     for(int i = 0;digit2[i] != ','; i++ ){
  226.         vorkommazahlen_digit2 = i+1;
  227.         if(digit2[i] == '\0'){
  228.         vorkommazahlen_digit2 -=1;
  229.         break;}
  230.     }
  231.  
  232.     for(int i = 0;digit1[i] != '\0'; i++ ){ // zählt nach dem komma
  233.         if (komma_ja_1 == 1)
  234.         nachkommazahlen_digit1 += 1;
  235.  
  236.         if(digit1[i] == ','){
  237.         komma_ja_1 += 1;
  238.         komma_pos_1 = i;}
  239.     }
  240.  
  241.     for(int i = 0;digit2[i] != '\0'; i++ ){
  242.         if (komma_ja_2 == 1)
  243.         nachkommazahlen_digit2 += 1;
  244.  
  245.         if(digit2[i] == ','){
  246.         komma_ja_2 += 1;
  247.         komma_pos_2 = i;}
  248.     }
  249.  
  250.     if(vorkommazahlen_digit1 >= vorkommazahlen_digit2){
  251.         gros_vorkommazahl = vorkommazahlen_digit1;
  252.         }else{
  253.         gros_vorkommazahl = vorkommazahlen_digit2;}
  254.  
  255.     if(nachkommazahlen_digit1 >= nachkommazahlen_digit2){
  256.         gros_nachkommazahl = nachkommazahlen_digit1;
  257.         }else{
  258.         gros_nachkommazahl = nachkommazahlen_digit2;}
  259.  
  260. if(komma_ja_1 == 0 && komma_ja_2 == 0){
  261. speicher = gros_nachkommazahl + gros_vorkommazahl;}
  262.  
  263.  
  264. if(komma_ja_1 == 1 && komma_ja_2 == 0){
  265. speicher = gros_nachkommazahl + gros_vorkommazahl + 1;
  266. komma_end = speicher - gros_nachkommazahl - 1 ;}
  267.  
  268.  
  269. if(komma_ja_1 == 0 && komma_ja_2 == 1){
  270. speicher = gros_nachkommazahl + gros_vorkommazahl + 1;
  271. komma_end = speicher - gros_nachkommazahl - 1;}
  272.  
  273.  
  274. if(komma_ja_1 == 1 && komma_ja_2 == 1){
  275. speicher = gros_nachkommazahl + gros_vorkommazahl +1;
  276.     komma_end = speicher - gros_nachkommazahl - 1;}
  277.  
  278. char *digitfull_1 = (char *)malloc(speicher * sizeof(char));
  279. char *digitfull_2 = (char *)malloc(speicher * sizeof(char));
  280.  
  281. int laenge_digit1 = speicher - vorkommazahlen_digit1;
  282. int laenge_digit2 = speicher - vorkommazahlen_digit2;
  283.  
  284.  
  285. for(int i = 0; i < speicher; i++)
  286.     digitfull_1[i] = '0';
  287. digitfull_1[speicher] = '\0';
  288.  
  289. for(int i = 0; i < speicher; i++)
  290.     digitfull_2[i] = '0';
  291. digitfull_2[speicher] = '\0';
  292.  
  293.  
  294. if(komma_ja_1 == 0 && komma_ja_2 == 0){
  295.     if(vorkommazahlen_digit1 > vorkommazahlen_digit2){
  296.         for(int i = gros_vorkommazahl-1; i >= 0; i--){
  297.             digitfull_1 [i] = digit1[i];
  298.  
  299.             if(digit1[i] < 48 || digit1[i] > 57)
  300.             digitfull_1 [i] = '0';
  301.         }
  302.  
  303.         for(int i = vorkommazahlen_digit2-1; i >= 0; i--){ // hier stand mal int i =  vorkommazahlen_digit2-1
  304.             digitfull_2 [i+laenge_digit2] = digit2[i];
  305.  
  306.             if(digit2[i-vorkommazahlen_digit2] < 48 || digit2[i] > 57)
  307.             digitfull_2 [i-laenge_digit2] = '0';
  308.  
  309.  
  310.         }
  311.     }
  312.  
  313.     if(vorkommazahlen_digit1 < vorkommazahlen_digit2){
  314.           for(int i = gros_vorkommazahl-1; i >= 0; i--){
  315.                     digitfull_2 [i] = digit2[i];
  316.  
  317.                     if(digit2[i] < 48 || digit2[i] > 57)
  318.                     digitfull_2 [i] = '0';
  319.                 }
  320.  
  321.         for(int i = vorkommazahlen_digit1-1; i >= 0; i--){ // hier stand mal int i =  vorkommazahlen_digit2-1
  322.             digitfull_1 [i+laenge_digit1] = digit1[i];
  323.  
  324.             if(digit1[i-vorkommazahlen_digit1] < 48 || digit1[i] > 57)
  325.             digitfull_1 [i-laenge_digit1] = '0';
  326.         }
  327.     }
  328.  
  329.     if(vorkommazahlen_digit1 == vorkommazahlen_digit2){
  330.           for(int i = gros_vorkommazahl-1; i >= 0; i--){
  331.                     digitfull_1 [i] = digit1[i];
  332.  
  333.                     if(digit1[i] < 48 || digit1[i] > 57)
  334.                     digitfull_1 [i] = '0';
  335.                 }
  336.  
  337.            for(int i = gros_vorkommazahl-1; i >= 0; i--){
  338.                     digitfull_2 [i] = digit2[i];
  339.  
  340.                     if(digit2[i] < 48 || digit2[i] > 57)
  341.                     digitfull_2 [i] = '0';
  342.                 }
  343.     }
  344. }
  345.  
  346. if(komma_ja_1 == 1 && komma_ja_2 == 0){
  347. digitfull_1[komma_end] = ',';
  348. digitfull_2[komma_end] = ',';
  349.  
  350.  
  351.     for(int i = 0; i < gros_vorkommazahl ; i++){ // füllt vordere zahlen
  352.         digitfull_1[komma_end-1-i] = digit1[komma_pos_1-1-i];
  353.  
  354.         if(komma_pos_1-1-i < 0)
  355.         digitfull_1[komma_end-1-i] = '0';
  356.  
  357.     }
  358.  
  359.     for(int i = 0; i < gros_nachkommazahl; i++){
  360.         digitfull_1[komma_end+1+i] = digit1[komma_pos_1+1+i];
  361.     }
  362.  
  363.     for(int i = 0; i < gros_vorkommazahl; i++){         // schleife für die digit2
  364.         digitfull_2[komma_end-1-i] = digit2[vorkommazahlen_digit2-1-i];
  365.  
  366.         if(vorkommazahlen_digit2-1-i < 0)
  367.         digitfull_2[komma_end-1-i] = '0';
  368.  
  369.     }
  370.  
  371. }
  372.  
  373. if(komma_ja_1 == 0 && komma_ja_2 == 1){
  374. digitfull_1[komma_end] = ',';
  375. digitfull_2[komma_end] = ',';
  376.  
  377.   for(int i = 0; i < gros_vorkommazahl; i++){         // schleife für die digit2
  378.         digitfull_1[komma_end-1-i] = digit1[vorkommazahlen_digit1-1-i];
  379.  
  380.         if(vorkommazahlen_digit1-1-i < 0)
  381.         digitfull_1[komma_end-1-i] = '0';
  382.  
  383.     }
  384.  
  385.         for(int i = 0; i < gros_vorkommazahl ; i++){ // füllt vordere zahlen
  386.         digitfull_2[komma_end-1-i] = digit2[komma_pos_2-1-i];
  387.  
  388.         if(komma_pos_2-1-i < 0)
  389.         digitfull_2[komma_end-1-i] = '0';
  390.  
  391.     }
  392.  
  393.     for(int i = 0; i < gros_nachkommazahl; i++){
  394.         digitfull_2[komma_end+1+i] = digit2[komma_pos_2+1+i];
  395.     }
  396.  
  397. }
  398.  
  399. if(komma_ja_1 == 1 && komma_ja_2 == 1){
  400. digitfull_1[komma_end] = ',';
  401. digitfull_2[komma_end] = ',';
  402.  
  403.   for(int i = 0; i < gros_vorkommazahl ; i++){ // füllt vordere zahlen
  404.         digitfull_1[komma_end-1-i] = digit1[komma_pos_1-1-i];
  405.  
  406.         if(komma_pos_1-1-i < 0)
  407.         digitfull_1[komma_end-1-i] = '0';
  408.  
  409.     }
  410.  
  411.     for(int i = 0; i < gros_nachkommazahl; i++){
  412.         digitfull_1[komma_end+1+i] = digit1[komma_pos_1+1+i];
  413.  
  414.         if(komma_end+1+i > komma_end + nachkommazahlen_digit1)
  415.         digitfull_1[komma_end+1+i] = '0';
  416.     }
  417.  
  418.     for(int i = 0; i < gros_vorkommazahl ; i++){ // füllt vordere zahlen
  419.         digitfull_2[komma_end-1-i] = digit2[komma_pos_2-1-i];
  420.  
  421.         if(komma_pos_2-1-i < 0)
  422.         digitfull_2[komma_end-1-i] = '0';
  423.  
  424.     }
  425.  
  426.     for(int i = 0; i < gros_nachkommazahl; i++){
  427.         digitfull_2[komma_end+1+i] = digit2[komma_pos_2+1+i];
  428.  
  429.         if(komma_end+1+i > komma_end + nachkommazahlen_digit2)
  430.         digitfull_2[komma_end+1+i] = '0';
  431.     }
  432.  
  433. }
  434.  
  435.  /* printf("vorkommazahlen_digit1 in null_fill: %d\n", vorkommazahlen_digit1);
  436.   printf("nachkommazahlen_digit1 in null_fill: %d\n", nachkommazahlen_digit1);
  437.   printf("vorkommazahlen_digit2 in null_fill: %d\n", vorkommazahlen_digit2);
  438.   printf("nachkommazahlen_digit2 in null_fill: %d\n", nachkommazahlen_digit2);
  439.   printf("gros_vorkommazahl in null_fill: %d\n", gros_vorkommazahl);
  440.   printf("gros_nachkommazahl in null_fill: %d\n", gros_nachkommazahl);
  441.     printf("komma_pos_1 in null_fill: %d\n", komma_pos_1);
  442.   printf("komma_pos_2 in null_fill: %d\n", komma_pos_2);
  443.    printf("komma_ja_1 in null_fill: %d\n", komma_ja_1);
  444.   printf("komma_ja_2 in null_fill: %d\n", komma_ja_2);
  445.   printf("komma_end in null_fill: %d\n", komma_end);
  446.   printf("digitfull_1 in null_fill: %s\n", digitfull_1);
  447.   printf("digitfull_2 in null_fill: %s\n", digitfull_2);
  448.   printf("speicher in null_fill: %d\n", speicher); */
  449.  
  450.     printf("digitfull_1 in null_fill nach allem: %s\n", digitfull_1);
  451.     printf("digitfull_2 in null_fill nach allem: %s\n", digitfull_2);
  452.  
  453.  
  454. for(int i = 0; i < speicher; i++)
  455.     digit1[i] = digitfull_1[i];
  456. digit1[speicher] = '\0';
  457.  
  458. for(int i = 0; i < speicher; i++)
  459.     digit2[i] = digitfull_2[i];
  460. digit2[speicher] = '\0';
  461.  
  462. free(digitfull_1);
  463. free(digitfull_2);
  464. return 0;
  465. }
  466.  
  467.  
  468. char addition(char *digit1, char *digit2)
  469. {
  470.  
  471. printf("digit1 in add: %s\n", digit1);
  472. printf("digit2 in add: %s\n", digit2);
  473.  
  474. int speicher = digit_laenge(digit1) +1;
  475. int speicher2 = digit_laenge(digit1) ;
  476. char *result = (char *)malloc(speicher * sizeof(char));
  477.  
  478.  
  479.  
  480. for(int i = 0; i < speicher; i++) // ergebnis füllen mit 0en und erste stelle ist 0 für den übertrag
  481.     result[i] = 0;
  482. result[speicher] = '\0';
  483. result[0] = '0';
  484.  
  485.  
  486. int ia = 0;
  487. int ia_vorcast = 0;
  488. int ib = 0;
  489. int ib_vorcast = 0;
  490. int ic = 0;
  491. int ubertrag = 0;
  492. int rest = 0;
  493.  
  494.     printf("result vor allem lautet: %s\n", result);
  495.  
  496. for(int i = 1; i <= speicher-1; i++){
  497.  
  498.     ia_vorcast = digit1[speicher - i - 1];
  499.     ib_vorcast = digit2[speicher - i - 1];
  500.  
  501.  
  502.     ia = ia_vorcast - 48;
  503.     ib = ib_vorcast - 48;
  504.     ubertrag = result[speicher - i];
  505.     ic = ia + ib + ubertrag ;
  506.  
  507.     if(ic < 9 && ia_vorcast != ','){
  508.     result[speicher - i] = 0;
  509.     result[speicher - i] += ic + 48;
  510.     }
  511.  
  512.     if(ic >= 9 && ia_vorcast != ','){
  513.     rest = ic % 9;
  514.     result[speicher - i] = 0;
  515.     result[speicher - i] += rest + 48;
  516.     if(digit1[speicher - i -2] == ','){
  517.         result[speicher - i -2] += 1;}else{
  518.         result[speicher - i -1] += 1;}
  519.     }
  520.  
  521.     if(ia_vorcast == ',' && ib_vorcast == ','){
  522.     result[speicher - i] = ',';}
  523.  
  524.  
  525.     }
  526.  
  527.     if(result[0] == '0'){
  528.             for(int i = 0; i < speicher; i++)
  529.     result[i] = result[i+1];
  530.     result[speicher2] = '\0';
  531.  
  532.  
  533.     }
  534.  
  535.     printf("result lautet: %s\n", result);
  536. free(result);
  537. return 0;
  538. }
  539.  
  540. char subtraktion(char *digit1, char *digit2)
  541. {
  542.  
  543. int speicher = digit_laenge(digit1) +1;
  544. int speicher2 = digit_laenge(digit1);
  545.  
  546. char *digitzwischenspeicher = (char *)malloc(speicher2 * sizeof(char));
  547. char *result = (char *)malloc(speicher * sizeof(char));
  548.  
  549. int ia = 0;
  550. int ia_vorcast = 0;
  551. int ib = 0;
  552. int ib_vorcast = 0;
  553. int ic = 0;
  554. int zahl = 0;
  555. int digit1_gros_ja = 0;
  556. int digit2_gros_ja = 0;
  557. int ubertrag = 0;
  558. int ib_ubertrag = 0;
  559.  
  560.  
  561. for(int i = 0; i < speicher; i++)
  562.     result[i] = 0;
  563. result[speicher] = '\0';
  564. result[0] = '0';
  565.  
  566.  
  567.  
  568. for(int i = 0;i < speicher; i++){
  569.     if(digit1[i] > digit2[i]){
  570.     digit1_gros_ja = 1;
  571.     break;}
  572.  
  573.     if(digit1[i] < digit2[i]){
  574.     digit2_gros_ja = 1;
  575.     break;}
  576.  
  577. }
  578.  
  579.  
  580. if(digit2_gros_ja == 1){
  581.   for(int i = 0; i < speicher2; i++){
  582.     digitzwischenspeicher[i] = digit2[i];
  583.     digitzwischenspeicher[speicher2] = '\0';
  584.   }
  585.   for(int i = 0; i < speicher2; i++){
  586.     digit2[i] = digit1[i];
  587.     digit2[speicher2] = '\0';
  588.   }
  589.   for(int i = 0; i < speicher2; i++){
  590.     digit1[i] = digitzwischenspeicher[i];
  591.     digit1[speicher2] = '\0';
  592.   }
  593. }
  594.  
  595. if(digit1_gros_ja == 0 && digit2_gros_ja == 0){
  596. printf("0 \n");
  597.  
  598. }
  599.  
  600.  
  601. for(int i = 1; i <= speicher-1; i++){
  602.     ia_vorcast = digit1[speicher - i - 1];
  603.     ib_vorcast = digit2[speicher - i - 1];
  604.  
  605.  
  606.     ia = ia_vorcast - 48;
  607.     ib = ib_vorcast - 48;
  608.     ubertrag = result[speicher - i];
  609.     ib_ubertrag = ib + ubertrag;
  610.     ic = ia - (ib + ubertrag);
  611.  
  612.     if(ib_ubertrag == 9 && ia != ',' ){
  613.         result[speicher -i]= ia;
  614.         result[speicher -i -1]= 1;
  615.     }
  616.  
  617.     if(ic >= 0 && ia != ',' ){
  618.         result[speicher-i] = ic + 48;
  619.     }
  620.  
  621.     if(ic < 0 && ia != ','){
  622.         zahl = (9+ia) - ib - ubertrag;
  623.         result[speicher-i] = zahl + 48;
  624.         result[speicher -i -1]= 1;
  625.         if(digit1[speicher - i - 2] == ',')
  626.             result[speicher -i -2]= 1;
  627.     }
  628.  
  629.     if(ia_vorcast == ',' && ib_vorcast == ','){
  630.     result[speicher - i] = ',';}
  631.  
  632. }
  633.     null_move(result);
  634.     printf("%s\n", result);
  635.  
  636. free(result);
  637. free(digitzwischenspeicher);
  638. return 0;
  639. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement