Jupyter Notebook C пользовательский ввод - PullRequest
0 голосов
/ 13 сентября 2018

Я пытаюсь написать простой код на C в блокноте Jupyter, который принимает ввод пользователя.Примером этого является:

// Problem 7.4
// Write a program that calculates the average of an array of 10 floating-point values.

    #include <stdio.h>

    int main (void)
    {
        float values[10] = {0};

        for ( int i = 0; i <= 10; i++ )
        {
            printf("Enter the %ith number: ", i);
            scanf("%f", &values[i]);
            printf("\n");
        }
    }

и вывод просто:

Enter the 0th number: 
Enter the 1th number: 
Enter the 2th number: 
Enter the 3th number: 
Enter the 4th number: 
Enter the 5th number: 
Enter the 6th number: 
Enter the 7th number: 
Enter the 8th number: 
Enter the 9th number: 
Enter the 10th number: 

, не давая возможности для пользовательского ввода.Есть ли способ сделать это ядро ​​Jupyter C?

1 Ответ

0 голосов
/ 13 сентября 2018

Есть ли способ сделать это ядром Jupyter C?

Не сейчас. Похоже, они все еще работают над этим.

См .: https://github.com/brendan-rius/jupyter-c-kernel/issues/3

...