#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>intmain(){int a =0, b =0;for(a =1, b =1; a <=100; a++){if(b >=20)break;if(b %3==1){
b = b +3;continue;}
b = b -5;}printf("%d %d\n", a,b);printf("\n------------------------------\n");//求1到100中数字9的个数int i =0;int count =0;for(i =1; i <=100; i++){if(i %10==9)
count++;if(i /10==9)
count++;}printf("%d\n", count);printf("\n------------------------------\n");//分数求和 -- 计算1/1 - 1/2 + ........+ 1/99 - 1/100的值int j =0;double sum =0;int flag =1;for(j =1; j <=100; j++){
sum += flag*1.0/ j;
flag =-flag;}printf("%lf\n", sum);printf("\n------------------------------\n");//求最大值int arr[]={1,-2,-3,4,5,11,7,8,9,10};int max = arr[0];int k =0;int sz =sizeof(arr)/sizeof(arr[0]);for(k =0; k < sz; k++){if(arr[k]> max){
max = arr[k];}}printf("max = %d\n", max);return0;}
822------------------------------20------------------------------0.688172------------------------------
max =11
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>intmain(){//乘法口诀表int i =0;int j =0;for(i =1; i <=9; i++){for(j =1; j <= i; j++){printf("%d*%d=%-2d ", i, j, i * j);//%-2d--输出两位数,且左对齐,不加-则右对齐}printf("\n");}return0;}
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main() { int a = 0, b = 0; for (a = 1, b = 1; a <= 100; a++) { if (b >= 20) break; if (b % 3 == 1) { b = b + 3; continue; } b = b - 5; } printf("%d %d\n", a,b); pri