Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
603 B
1
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;

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