提问人:rvevau 提问时间:10/12/2023 更新时间:10/12/2023 访问量:52
如何在 C 控制台中输入括号中的值和带有度数的数字
How to enter values in brackets and numbers with a degree in C console
问:
我有一个无符号长长 int 类型的数组,值通过控制台在一行中输入,其中有 (2^32-1)^2-1 和 (2^32-1)^2+1。
如何将其转换为自然数?
我尝试使用:
scanf("%llu^%llu", &numbers[i], °ree[i]);
result[i] = pow(numbers[i], degree[i]);
但它只在少数情况下有效
答: 暂无答案
评论
scanf()
pow()
fgets()
scanf