gpt4 book ai didi

c - 简单的 C Oddity

转载 作者:太空宇宙 更新时间:2023-11-04 00:13:05 24 4
gpt4 key购买 nike

<分区>

这一小段 C 代码让我抓狂。它询问输入电压,但随后它跳过电阻器 1 并询问电阻器 2。我在这里遗漏了一些非常明显的东西......到底发生了什么......

#include <stdio.h>
int main()
{
float Vin;
int R1;
int R2;

printf("Input Voltage: ");
scanf("%.3f", &Vin);

printf("\nResistor 1: ");
scanf("%d", &R1);

printf("\nResistor 2: ");
scanf("%d", &R2);

return(0);
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com