Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
613 B
4
Indexable
Never
#include <stdlib.h>

int main()
{
    float a, b;
    int n1, n2, v1, v2;
    int i = 0, j = 0;

    printf("a:");
    scanf("%f", &a);
    printf("b:");
    scanf("%f", &b);
    printf("n1:");
    scanf("%d", &n1);
    printf("n2:");
    scanf("%d", &n2);
    printf("v1:");
    scanf("%d", &v1);
    printf("v2:");
    scanf("%d", &v2);
    float step1 = b/n2, step2 = a/n1;

    for (int i = 0; i <= n2; i++)
    {
        for (int j = 0; j <= n1; j++)
        {
            printf("%f %f %d %d",i*step1,j*step2,v1,v2);
            printf("\n");
        }
    }
    return 0;
}