• CodeBlocks调试功能(转)


    转自:迂者-贺利坚

    http://blog.csdn.net/sxhelijian/article/details/15026159








    示例代码:

    1. #include <iostream>  
    2. using namespace std;  
    3. const double pi=3.1415926;  
    4. int main( )  
    5. {  
    6.     float r,a;  
    7.     cout<<"输入半径:"<<endl;  
    8.     cin>>r;  
    9.     a=pi*r*r;  
    10.     cout<<"输出面积:";  
    11.     cout<<a<<endl;  
    12.     return 0;  
    13. }  
    14.   
    15. float volume(float h,float r)  
    16. {  
    17.     return pi*r*r*h;  
    18. }  







    实践代码:

    1. #include <iostream>  
    2. using namespace std;  
    3. const double pi=3.1415926;  
    4. int main( )  
    5. {  
    6.     int a;  
    7.     cout<<"请输入一个数:"<<endl;  
    8.     cin>>a;  
    9.     if(a = 2)  
    10.         cout<<"你2了。";  
    11.     else  
    12.         cout<<"你不2。";  
    13.     return 0;  
    14. }  




    示例代码:

    1. #include <iostream>  
    2. using namespace std;  
    3. const double pi=3.1415926;  
    4. float area(float r);  
    5. int main( )  
    6. {  
    7.     float r1,a1;  
    8.     cin>>r1;  
    9.     a1=area(r1);  
    10.     cout<<a1<<endl;  
    11.     return 0;  
    12. }  
    13. float area(float r)  
    14. {  
    15.     float a;  
    16.     a = pi*r*r;  
    17.     return a;  
    18. }  




    实践代码:

    1. #include <iostream>  
    2. using namespace std;  
    3. float max(float x, float y);  
    4. int main ()  
    5. {  
    6.     float a,b,c;  
    7.     cin>>a>>b;  
    8.     c=max(a, b) ;  
    9.     cout<<"The max is "<<c<<endl;  
    10.     return 0;  
    11. }  
    12. float max(float x, float y)  
    13. {  
    14.     float z;  
    15.     z=(x<y)? x : y ;  
    16.     return  z;  
    17. }  



    示例代码:

    1. #include<iostream>  
    2. #include<cmath>  
    3. using namespace std;  
    4. int max(int,int);  
    5. int main( )  
    6. {  
    7.     int m,a,b;  
    8.     a=100;  
    9.     b=200;  
    10.     m=max(a,b);  
    11.     cout<<"最大:"<<m<<endl;  
    12.     return 0;  
    13. }  
    14. int max(int x,int y)  
    15. {  
    16.     int z;  
    17.     if(x>y)  
    18.         z=x;  
    19.     else  
    20.         z=y;  
    21.     return z;  
    22. }  



    实践代码:

    1. #include <iostream>  
    2. using namespace std;  
    3. float max(float x, float y);  
    4. int main ()  
    5. {  
    6.     float a,b,c;  
    7.     cin>>a>>b;  
    8.     c=max(a, b) ;  
    9.     cout<<"The max is "<<c<<endl;  
    10.     return 0;  
    11. }  
    12. float max(float x, float y)  
    13. {  
    14.     float z;  
    15.     z=(x<y)? x : y ;  
    16.     return  z;  
    17. }  


  • 相关阅读:
    几种 JavaScript 动画库推荐
    微软工程师为你推荐了十本程序员必读书目
    前端新老手必备的34种JavaScript简写优化技术
    Airbnb 爱彼迎 visx 项目介绍
    开源中间件技术支持(5000+元/天)
    C# Byte数组与Int16数组之间的转换(转)
    【636】K.sum 与 np.sum 的区别
    【635】语义分割 label 通道与模型输出通道的
    【634】ndarray 提取行列进行任意变换 & 相关 ndarray 操作
    面试官:设计一个安全的登录都要考虑哪些?我一脸懵逼。。
  • 原文地址:https://www.cnblogs.com/XDJjy/p/3888834.html
Copyright © 2020-2023  润新知