如何将这个C ++代码转换为Turbo C?

时间:2015-09-19 05:17:04

标签: c++ turbo-c

C ++代码:

cout << "Roots are complex and different."  << endl;
cout << "x1 = " << realPart << "+" << imaginaryPart << "i" << endl;
cout << "x2 = " << realPart << "-" << imaginaryPart << "i" << endl;

如何将此转换为Turbo C,如printf而不是cout

1 个答案:

答案 0 :(得分:1)

你可能正在寻求这个:

printf("Roots are complex and different.\n");
printf("x1 = %lf+%lfi\n",realPart,imaginaryPart);
printf("x2 = %lf-%lfi\n",realPart,imaginaryPart);

如果realPartimaginaryPart变量属于数据类型double

%f使用float%d使用int%s使用string代替%lf代替chrome.tabs.executeScript(null,{code:"document.body.style.backgroundColor='yellow'"});