當前位置:編程學習大全網 - 電腦編程 - 關於C語言壹個循環控制程序的問題

關於C語言壹個循環控制程序的問題

#include <stdio.h>

#include <ctype.h>

#include <stdlib.h>

double Temperature(double Fahrenheit)

{

return 1.8 * Fahrenheit + 32.0;

}

void main()

{

char s[20];

int i = 0;

while(s[i++] = getchar())

{

if (!isdigit(s[i - 1]) && s[i - 1] != '\n')

{

break;

}

if (s[i - 1] == '\n')

{

printf("攝氏度為: %f\n", Temperature(atof(s)));

i = 0;

}

}

}

剛寫好的...手動辛苦碼啊...

  • 上一篇:數控編程三維偏置精加中的參考線有什麽用
  • 下一篇:AI時代,Python人工智能工程師待遇怎麽樣
  • copyright 2024編程學習大全網