Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
743 B
1
Indexable
Never
#include <stdlib.h>

int main()
{
    float a;
    float b;
    int n1;
    int n2;
    int v1;
    int v2;
    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;
    float 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");

            if (j == n1)
            {
                j = 0;
                break;
            }
        }
    }
    return 0;
}