高一编程题,VB高中编程作业

1,VB高中编程作业第一题可以用枚举 y=n-(m-2*x)/4 for x=1 to n if cint(y)=y then exit for next print x,y 第二题 dim a(1 to 3) as integer dim b as integer for b=1 to 3 a(b)=mid(text1.text,b,1) next print a(3)+a(2)+a(1) 你可以简化一下【高一编程题,VB高中编程作业】
2 , 高一编程题n=(n%100+((n-n%100)/100))*(n%100+((n-n%100)/100)123456int num=0; for(int n=1000;n<9999;n++) if(n==(n%100+((n-n%100)/100))*(n%100+((n-n%100)/100))num++ ; }
3 , 编程题目高手帮忙//4.输入10个整数存放到数组中,先顺序输出这十个数,在把这十个整数按小到大的顺序排列,并输出排序好的数 。#include<iostream>using namespace std;int main() int a[10],temp; cout<<"Input 10 NO.:"; for(int i=0;i<10;i++)cin>>a[i]; for(i=0;i<10;i++) cout<<a[i]<<","; for(int k=0;k<10;k++) for(int p=k;p<10;p++)if(a[k]>a[p])temp=a[k];a[k]=a[p];a[p]=temp;}for(i=0;i<10;i++)cout<<"\n"<<a[i]<<endl; }
4,高一编程数学题电脑高手进一、#include"stdio.h"void main()float sum=0;int n;printf("please input a number:");scanf("%d",&n);int a;for(a=1;a<=n;a++) sum=sum+1/n;printf("\n%f",sum);}二、1、定义一个长度为10的数组a[10] 。2、依次输入a[0]-a[9]3、定义N=a[0],i=1,从a[i]开始 , 依次比较a[i]和N大小 , 较大值赋与N4、i=9时比较结束,N为数组内最大值 。三、#include"stdio.h"void main()int i;printf("please input a number:");scanf("%d",&i);int n=i%7;switch(n)case 0:printf("Sunday");case 1:printf("Monday");case 2:printf("Tuesday ");case 3:printf("Wednesday ");case 4:printf("Thursday ");case 5:printf("Friday");case 6:printf("Saturday"); }}5,编程题计算135799101的值要求使用循环和函数实现#include <stdio.h>int s(void) int i, sum = 0; for(i = 1; i <= 101; i += 2) if ((i / 2) % 2) sum -= i; else sum += i; } return sum;}void main(void) printf("%d\n", s());}注意,题目要求:用函数实现 。#include <stdio.h>int main(void)int i,sum = 0,flag = 1; for(i = 1; i < 52; ++i)sum += flag * (2 * i - 1);flag = -flag; } printf("%d\n",sum); return 0;}#include <iostream>#include <cmath>using namespace std;int f() int sum = 0; for (int i = 1; i <= 101; i += 2)sum += pow(-1, i+1) * i; return sum;}int main() cout << f() << endl; return 0;}6,高一信息编程求大大解答第二题private sub command1_click() dim a as long dim s as long dim i as long if trim(text1.text) = "" then msgbox "请填写n的值!!", vbinformation, "-提 示-" exit sub elseif trim(text1.text) = "0" then msgbox "0不参于计算!", vbinformation, "-提 示-" exit sub else a = clng(trim(text1.text)) s = 1 for i = 1 to a s = s * i next i text2.text = str(s) end ifend sub 第三题:private sub command1_click() if trim(text1.text) = "" then msgbox "请输入年龄", vbinformation, "-提 示-" text1.setfocus exit sub else dim a as integer a = cint(text1.text) select case a case is < 18 text2.text = "青 年" case is < 60 text2.text = "中青年" case is >= 60 text2.text = "老 年" end select end ifend sub第四题:第四题:private sub command1_click() if trim(text1.text) = "" or trim(text2.text) = "" then msgbox "请填完整" elseif clng(text1.text) = clng(text2.text) then label1.caption = "两数相等!!" elseif clng(text1.text) > clng(text2.text) then label1.caption = text1.text else label1.caption = text2.text end ifend subprivate sub command2_click() text1.text = "" and text2.text = ""end sub第一题:见图/

    推荐阅读