楼主: l6397
3424 6

[SAS] [求助]高人:读取观察值的程序 [推广有奖]

  • 0关注
  • 0粉丝

博士生

42%

还不是VIP/贵宾

-

威望
0 级
论坛币
120 个
通用积分
16.6418
学术水平
1 点
热心指数
6 点
信用等级
0 点
经验
3788 点
帖子
235
精华
0
在线时间
178 小时
注册时间
2007-3-28
最后登录
2023-5-13

楼主
l6397 发表于 2008-1-5 22:13:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
<p>高人:</p><p>&nbsp;&nbsp;&nbsp;&nbsp; 下列一组数据:&nbsp; <table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="547" bgcolor="#ffffff" border="1" style="WIDTH: 547px; HEIGHT: 34px;"><tbody><tr><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;1</td><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;1</td></tr></tbody></table></p><p>1、怎样编程,来统计1出现的次数(按竖行输出下列形式)&nbsp;<table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="548" bgcolor="#ffffff" border="1" style="WIDTH: 548px; HEIGHT: 34px;"><tbody><tr><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;2</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;3</td><td>&nbsp;4</td><td>&nbsp;.</td><td>&nbsp;5</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;6</td></tr></tbody></table></p><p>2、怎样编程,数字1的间隔次数(按竖行输出下列形式)&nbsp;</p><p><table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="548" bgcolor="#ffffff" border="1" style="WIDTH: 548px; HEIGHT: 34px;"><tbody><tr><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;2</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;2</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;1</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;.</td><td>&nbsp;4</td><td>&nbsp;.</td></tr></tbody></table></p><p>&nbsp;求助高手帮我。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 谢谢!!</p><p></p>
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:怎样编程 求助高手 求助 程序 高人 观察

回帖推荐

yzhouwen 发表于6楼  查看完整内容

Thanks for the reminder, I modified the code a little bit, looks little better.data one;    input x @@;      cards;       1 2 1 1 0 0 2 1 1 8;  data two;      set one;       retain j 0;       do i=1 to _N_;    &n ...

yzhouwen 发表于4楼  查看完整内容

proc iml;/*the following program replace the jth 1 in a vector A by j */  A={1 1 0 6 1 0 1}; /* an other example*/   len=ncol(A);    j=0;            /* j denotes the jth 1 in A;*/   do i=1 to len;  /*A dnotes the ith element of A;*/       if A=1 the ...

yzhouwen 发表于3楼  查看完整内容

proc iml; iml;/*the following program replace the jth 1 in a vector A by j */A={1 1 0 6 1 0 1};len=ncol(A);j=0; /* j denotes the jth 1 in A;*/1 1 0 6 1 0 1};len=ncol(A);j=0; /* j denotes the jth 1 in A;*/0; /* j denotes the jth 1 in A;*/do i=1 to len; /*A dnotes the ith element of A;*/do i=1 to len; /*A dnotes the ith element of A;*/if A=1 then do;j=j+1;A ...

本帖被以下文库推荐

沙发
monkeyxu1983 发表于 2008-1-6 19:57:00
无能为力

藤椅
yzhouwen 发表于 2008-1-7 06:22:00
<b><font face="Courier New" color="#000080" size="2"><p>proc<font face="Courier New" size="2">
                                </font><b><font face="Courier New" color="#000080" size="2">iml</font></b><font face="Courier New" size="2">;</font></p></font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#000080" size="2">iml</font></b><font face="Courier New" size="2">;</font><font face="Courier New" color="#008000" size="2"><p>/*the following program replace the jth 1 in a vector A by j */</p></font><font face="Courier New" size="2"><p>A={<b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">6</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">
                        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">};<p>len=ncol(A);</p><p></p><p>j=<b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">; </font><font face="Courier New" color="#008000" size="2">/* j denotes the jth 1 in A;*/</font></p></font></p></font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">6</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">
        </font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">};<p>len=ncol(A);</p><p></p><p>j=<b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">; </font><font face="Courier New" color="#008000" size="2">/* j denotes the jth 1 in A;*/</font></p></font><b><font face="Courier New" color="#008080" size="2">0</font></b><font face="Courier New" size="2">; </font><font face="Courier New" color="#008000" size="2">/* j denotes the jth 1 in A;*/</font><font face="Courier New" size="2"><p><font face="Courier New" color="#ff0000" size="2">do</font><font face="Courier New" size="2"> i=</font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2"> to len; </font><font face="Courier New" color="#008000" size="2">/*A dnotes the ith element of A;*/</font></p></font><font face="Courier New" color="#ff0000" size="2">do</font><font face="Courier New" size="2"> i=</font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2"> to len; </font><font face="Courier New" color="#008000" size="2">/*A dnotes the ith element of A;*/</font><font face="Courier New" size="2"><p><font face="Courier New" color="#ff0000" size="2">if</font><font face="Courier New" size="2"> A=</font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2"> then do;<p>j=j+<b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">;<p>A=j; </p><p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font></p></font></p></font></p></font></p></font></p></font><font face="Courier New" color="#ff0000" size="2">if</font><font face="Courier New" size="2"> A=</font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2"> then do;<p>j=j+<b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">;<p>A=j; </p><p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font></p></font></p></font></p></font></p></font><b><font face="Courier New" color="#008080" size="2">1</font></b><font face="Courier New" size="2">;<p>A=j; </p><p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font></p></font></p></font></p></font><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font></p></font></p></font><font face="Courier New" color="#0000ff" size="2">end</font><font face="Courier New" size="2">;<p><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font></p></font><font face="Courier New" color="#0000ff" size="2">print</font><font face="Courier New" size="2"> A;</font><b><font face="Courier New" color="#000080" size="2"><p>quit<font face="Courier New" size="2">;<p></p></font></p></font></b><font face="Courier New" size="2">;<p></p></font>

[此贴子已经被作者于2008-1-7 6:24:41编辑过]

已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 10 精彩帖子

总评分: 经验 + 3  论坛币 + 10   查看全部评分

板凳
yzhouwen 发表于 2008-1-7 06:30:00
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">proc</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">iml</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: green; FONT-FAMILY: &quot;Courier New&quot;;">/*the following program replace the jth 1 in a vector A by j */</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp; </span>A={</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">0</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">6</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">0</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">}; /* an other example*/<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>len=ncol(A);<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span>j=</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">0</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: green; FONT-FAMILY: &quot;Courier New&quot;;">/* j denotes the jth 1 in A;*/</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: &quot;Courier New&quot;;">do</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> i=</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> to len;<span style="mso-spacerun: yes;">&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: green; FONT-FAMILY: &quot;Courier New&quot;;">/*A dnotes the ith element of A;*/</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: &quot;Courier New&quot;;">if</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> A=</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> then do;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>j=j+</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>A=j; <p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">end</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">end</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">print</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> A;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">quit</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p>
已有 1 人评分论坛币 收起 理由
bakoll + 10 精彩帖子

总评分: 论坛币 + 10   查看全部评分

报纸
abelus 发表于 2008-1-7 10:14:00
data 中使用retain也能做到,相对简洁一些。<br/>

地板
yzhouwen 发表于 2008-1-7 22:05:00
<p>Thanks for the reminder, I modified the code a little bit, looks little better.</p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">data</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> one;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">input</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> x @@;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">cards</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: #ffffc0; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>1 2 1 1 0 0 2 1 1 8<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><p>&nbsp;</p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;</span></span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">data</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> two;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">set</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> one;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">retain</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> j </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">0</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">do</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> i=</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">to</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> _N_;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">if</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> x=</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">then</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">do</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>j=j+</span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: teal; FONT-FAMILY: &quot;Courier New&quot;;">1</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>x=j;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">end</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">end</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">drop</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"> j i;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;"><span style="mso-spacerun: yes;">&nbsp;</span></span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">run</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none;"><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">proc</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">print</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">
                </span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: blue; FONT-FAMILY: &quot;Courier New&quot;;">noobs</span><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">; </span><b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: &quot;Courier New&quot;;">run</span></b><span style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: &quot;Courier New&quot;;">;<p></p></span></p><p><p></p><p></p></p>

7楼
l6397 发表于 2008-1-7 22:54:00
<div><div style="FILTER: glow(color='#A6BA98',strength='2'); FLOAT: left; WIDTH: 120px;"><font face="Verdana" color="#61b713"><b>yzhouwen</b></font></div></div><p><img alt="帅哥哟,在线,有人找我吗?" src="http://www.pinggu.org/bbs/skins/Default/Male.gif"/>&nbsp;<img height="32" alt="" src="http://down8.pinggu.org/images/userface/image1.gif" width="32"/>&nbsp;&nbsp;&nbsp;非常谢谢这位高人,感谢您的帮助!!</p><div>&nbsp;<font size="1">下列这些点代表其他数据(后面还有很多数据),我想在编程后输出时,</font></div><div><font size="1">不输出其他数字,只统计 1 出现的次数和距上次的间隔次数,输出形式</font></div><div><font size="1">如下:&nbsp;&nbsp;&nbsp; 谢谢!!</font></div><div><font size="1"></font></div><div><font size="1">下列一组数据:&nbsp;</font></div><div><table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="547" bgcolor="#ffffff" border="1" style="WIDTH: 547px; HEIGHT: 34px;"><tbody><tr><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;1</font></td></tr></tbody></table></div><p><font size="1">1、怎样编程,来统计1出现的次数(按竖行输出下列形式)&nbsp; </font><table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="548" bgcolor="#ffffff" border="1" style="WIDTH: 548px; HEIGHT: 34px;"><tbody><tr><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;2</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;3</font></td><td><font size="1">&nbsp;4</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;5</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;6</font></td></tr></tbody></table></p><p><font size="1">2、怎样编程,数字1的间隔次数(按竖行输出下列形式)&nbsp;</font></p><p><table bordercolor="#cccccc" cellspacing="2" cellpadding="1" width="548" bgcolor="#ffffff" border="1" style="WIDTH: 548px; HEIGHT: 34px;"><tbody><tr><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;2</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;2</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;1</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;.</font></td><td><font size="1">&nbsp;4</font></td><td><font size="1">&nbsp;.</font></td></tr></tbody></table></p>

[此贴子已经被作者于2008-1-7 22:57:26编辑过]

您需要登录后才可以回帖 登录 | 我要注册

客服
GMT+8, 2026-12-4 12:31