[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
一个完全入门初学者如何学代码,读代码和写代码,,我想学代码不知道方向谁能给我指明一个方向?
1、学代码:前提是你的复有一个比较系统的学习.认真完成每一个课程中的案例.
2、读代码:分制两步走:前期能读懂自己写的代码.2113
后期能读懂他人写的代码和大致的知道底层的某些源码的含义.多去5261看开发文档(开发文档建议使用官方提供的4102英文版、不要使用中文自己害自己)
3、写代
码1653:前提是你要有基础.
我是一名初学者,程序简单一点
c语言
#include"stdio.h"
void Calculate(){
float a=0;
float b=0;
printf("Input first number");
scanf("%f",&a);
printf("Input second number");
scanf("%f",&b);
printf("a+b=%f",a+b);
printf("a-b=%f",a-b);
printf("a*b=%f",a*b);
if(b!=0){
printf("a/b=%f",a/b);
}
else{
printf("The divisor can not be zero");
}
}
求一些供C语言初学者看的源代码
输入十个数,求出最大数.
#include
double max_number(double x[])
{
double max=x[0];
int i;
for(i=1;i<=9;i++)
{
if(max{
max=x[i];
}
}
return max;
}
void main()
{
double a[10];
int i;
printf("请输入十个数:\n");
for(i=0;i<=9;i++)
{
scanf("%lf,",&a[i]);
}
printf("最大数为:%.4f\
n",max_number(a));
}
看代码的时候要学习一个代码的什么?
对于一个初学者来讲,那就是程序最初的含义:算法加数据结构.这两样就是我们最主要学的.
而对于一个相对成熟的程序员来讲,要看代码的可读性,可维护性,可持续性.
可读性:即编程规范.
1)注释:
> 注释没有根据代码变化进行同步更新
> 注释有误,常见代码注释copy后,没有修改注释÷
> 文件头、函数注释不完整
2)易看
> 避免使用复杂的表达式,注意运算符优先级
3)排版
4)魔鬼数字
> 有逻辑或业务含义的数字都应定一宏或使用常量字符串代替
5)命名规则
> 符合命名规则,且变量名整体风格要一致
等等.
可维护性:其中之一就包含了可读性,可读性强的代码自然遇到问题容易找.再者看代码的模块独立性是否强,修改其中一块代码是否会影响其他代码.或者修改一个问题,是否需要到处修改.
可持续性:这个主要看设计的人是否想到以后有扩展的可能性,接口和数据结构扩展性是否灵活.
如果是一个高手:看程序是否有更好的方法可以去实现.一般会从性能上去考虑.