index — ti25-glauchau-code @ 95fb20a9c30ec4c29b0f8eba4058d61cb32dad89

Meine Lösungen (oder auch nicht) für die Programmieraufgaben in der TI25 an der Staatlichen Studienakademie Glauchau

gpt/2025-12-09/structtest.c (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
#include <stdio.h>
#include <stdlib.h>

typedef struct point3D {
    char name;
    float x;
    float y;
    float z;
} p3d;

int main(){
    p3d *p;
    p = (p3d*) malloc(sizeof(p3d));

    printf("name, x, y, z:\n");
    scanf("%c", &p->name);
    scanf("%f", &p->x);
    scanf("%f", &p->y);
    scanf("%f", &p->z);
    printf("Koordinaten von %c: (%f, %f, %f)", p->name,p->x,p->y,p->z);

    return 0;
}