小编bob*_*808的帖子

如何在if语句中指定单引号?

if(ch == ''')
{
   word_len++;
}
Run Code Online (Sandbox Code Playgroud)

如何指定何时ch等于'它添加一个word_len?似乎我只能使用上面的代码来指定它.

c if-statement format-specifiers

1
推荐指数
1
解决办法
50
查看次数

如何在没有Goto语句的情况下返回程序的开头

#include <stdio.h>
#include <math.h>

long factcalc(int num1);

int main(void) 
{
    int num1;
    long factorial;
    int d;
    int out;

    printf("Please enter a number that is greater than 0");
    scanf_s("%d", &num1);

    if (num1 < 0) {
        printf("Error, number has to be greater than 0");
    } else if (num1 == 0) {
        printf("\nThe answer is 1");
    } else {
        factorial = factcalc(num1);
        printf("\nThe factorial of your number is\t %ld", factorial);
    }

    return 0;
}

long factcalc(int num1) 
{
    int factorial = 1;
    int …
Run Code Online (Sandbox Code Playgroud)

c loops function break

0
推荐指数
1
解决办法
2142
查看次数

标签 统计

c ×2

break ×1

format-specifiers ×1

function ×1

if-statement ×1

loops ×1