#include <stdio.h>
void f(int *a,int *m)
{
int i,j;
for(i=;i < *m;i++)
if(a[i] < )
{
for(j=i--;j < *m-;j++)
a[j]=a[j+];
(*m)-- ;
}
} void main()
{
int i,n=,x[]={,-,,,-,,-};
f(x,&n);//数组就是地址,但n不是
for(i=;i < n;i++)
printf("%5d",x[i]);
printf("\n");
}

Problem F: 程序填充(函数、指针):去数组负数的更多相关文章

  1. Problem D: 程序填充(递归函数):数列2项和

    Problem D: 程序填充(递归函数):数列2项和 Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 2601  Solved: 2117 Descrip ...

  2. (60) 结构体指针、结构体变量嵌套、结构体指针嵌套、函数指针、数组指针、指针数组、typedef 综合运用

    #include<stdio.h> #include<iostream> #include<malloc.h> /* author : 吴永聪 program: 结 ...

  3. C与指针(结构体指针,函数指针,数组指针,指针数组)定义与使用

    类型 普通指针 指针数组(非指针类型) 数组指针 结构体指针 函数指针 二重指针 定义方式 int *p; int *p[5]; int (*p)[5]; int a[3][5]; struct{.. ...

  4. Problem F: 零起点学算法85——数组中插入一个数

    #include<stdio.h> int main() { ],b[]; while(scanf("%d",&n)!=EOF) { ;i<n;i++) ...

  5. Z :彻底了解指针数组,数组指针以及函数指针 [复

    原创 :彻底了解指针数组,数组指针以及函数指针 [复制链接] 00 roking 白手起家 帖子 60 主题 16 精华 0 可用积分 74 专家积分 0 在线时间 0 小时 注册时间 2003-10 ...

  6. CPP-基础:函数指针,指针函数,指针数组

    函数指针 函数指针是指向函数的指针变量. 因而“函数指针”本身首先应是指针变量,只不过该指针变量指向函数.这正如用指针变量可指向整型变量.字符型.数组一样,这里是指向函数.如前所述,C在编译时,每一个 ...

  7. 拒绝switch,程序加速之函数指针数组

    先看一个使用switch语句的程序: #include <stdio.h> #include <time.h> //加法 int add(int a,int b) { retu ...

  8. C 函数指针 函数指针数组 转移表

    内容来自<c和指针>,整理后方便个人理解 高级声明 cdel程序可以方便的给出声明的释义 指向函数的指针 int ( *f ) ( int n_values, float amount ) ...

  9. c语言.函数指针数组

    函数指针: 一个指向函数的指针.一般用函数名表示. 函数指针数组:元素为函数指针的数组.转移表.c语言中函数不可以定义为数组,只能通过定义函数指针来操作. #include<stdio.h> ...

随机推荐

  1. nginx路由文件配置

    nginx中文文档 Nginx 的请求处理有多个阶段,比如说rewrite.access.content等等,不同的配置字段属于不同的配置阶段,不同阶段的先后执行顺序不一样,例如rewrite在con ...

  2. Coursera助学金申请模板

    讲真,我觉得coursera的课还挺贵的.但是它有助学金系统,非常对我们穷学生友好了,而且基本上申请的都会批.不过现在助学金需要15个工作日才有答复,所以注意要提前申请. 有两大段要填. 虽然写的挺烂 ...

  3. linux===进程操作

    ps -ef ps -aux|grep chat.js a:显示所有程序 u:以用户为主的格式来显示 x:显示所有程序,不以终端机来区分 kill -9 nohup python da.py & ...

  4. Linux 内核通知链随笔【中】【转】

    转自:http://blog.chinaunix.net/uid-23069658-id-4364171.html 关于内核通知链不像Netlink那样,既可以用于内核与用户空间的通信,还能用于内核不 ...

  5. An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceModel.dll

    异常“ An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceMo ...

  6. [New learn] UIKit 框架类

    NSObject NSObject is the root class of most Objective-C class hierarchies. NSDataAsset The NSDataAss ...

  7. c语言实现CRC校验和

    最近在摄像头采集的数据清晰度上需要加强,则在每一帧传输的数据包后边加了CRC校验和.CRC校验和有16位的,也有32位的.至于CRC校验和算法原理,我是在百度上学习的,其实网上有很多这种资料.简单的说 ...

  8. form表单 datalist 和legend

    <form action="" method="post" > <fieldset> <legend> 表单元素 </ ...

  9. CF633F The Chocolate Spree

    Description Alice and Bob have a tree (undirected acyclic connected graph). There are \(a_{i}\) choc ...

  10. HDU-1671

    Phone List Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...