++++++++++you

1.猜数字
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int a, b;
srand(time(0));
a = rand() % 100 + 1;
while (a)
{
printf(“请输入一个数:”);
scanf("%d", &b);
if (a > b){
printf(“猜小了\n”);
}
else if (a < b){
printf(“猜大了\n”);
}
if (a == b) {
printf(“猜对了\n”);
break;
}
}
system(“pause”);
return 0;
}
2.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int b, n, c = 0, mid=0;
int arr[4] = { 2, 5, 7, 9 };
n = sizeof(arr) / sizeof(arr[0])-1;
printf(“请输入一个数查找:”);
scanf("%d", &b);
while (c <= n){
mid = (c + n) / 2;
if (arr[mid] > b){
n = mid - 1;
}
else if (arr[mid] < b){
c = mid + 1;
}
else
break;
}
if (c <= n){
printf(“找到了,下标是%d\n”, mid);
}
else printf("-1\n");
system(“pause”);
return 0;
}
3.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
char password[] = “”;
int count = 0;
printf(“请输入密码:”);
while (count<=3){
scanf("%s", password);
count++;
if (strcmp(password, “123456”) == 0){
printf(“登陆成功\n”);
break;
}
else{
if (count< 3){
printf(“密码错误,请重新输入:”);
}
else{
printf(“退出\n”);
break;
}
}
}
system(“pause”);
return 0;
}
4.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
char n;
printf(“请输入一个字符:”);
scanf("%c", &n);
while (1)
{
if (n >= ‘a’ && n <= ‘z’){
printf("%c\n", n - 32);
break;
}
else if (n >= ‘A’ && n <= ‘Z’){
printf("%c\n", n + 32);
break;
}
else{
break;
}
}
system(“pause”);
return 0;
}
打的代码还不行,速率效率都不行,加把劲,学过的忘得也快,勤加练习,才会提升自我,未来靠自己,为自己奋斗吧。

### OAT++ Framework Usage and Documentation OAT++ is a modern C++ web framework designed to simplify the development of RESTful APIs and microservices. It provides an efficient way to build scalable applications with minimal boilerplate code while maintaining high performance. Below are some key aspects regarding its usage: #### Installation To use OAT++, you need to install it via package managers such as vcpkg or directly from source using Git repositories. The following command demonstrates how to clone the repository: ```bash git clone https://github.com/Oatpp/oatpp.git ``` Once cloned, follow the instructions provided in their official documentation for building and linking against your project[^1]. #### Basic Structure of Applications Using OAT++ An application built on top of OAT++ typically consists of components like controllers, services, interceptors, etc., which interact seamlessly through dependency injection mechanisms. Here’s an example illustrating setting up a simple HTTP server that listens at port `8000` serving JSON responses. ```cpp #include "oatpp/web/server/HttpServer.hpp" #include "oatpp/core/macro/component.hpp" class MyController : public oatpp::web::server::controller::AbstractController { public: ENDPOINT("GET", "hello", helloWorld) { auto dto = HelloDto::createShared(); dto->message = "Hello World!"; return createResponse(Status::CODE_200, dto); } }; int main() { oatpp::base::Environment::init(); /* Create Router */ auto router = std::make_shared<oatpp::web::server::Router>(); /* Add Controller endpoints to router */ MyController controller; controller.addEndpoints(router); /* Configure TCP connection provider */ auto connectionHandler = oatpp::network::tcp::server::ConnectionHandler::createShared( oatpp::network::Address{"localhost", 8000} ); /* Run Server */ oatpp::web::server::HttpServer httpServer(connectionHandler, router); OATPP_RUN_SERVER(httpServer); } ``` This snippet sets up a basic endpoint `/hello`, returning `"Hello World!"`. #### Debugging Memory Utilization (Dalvik & ART Context) When working within Android environments where Dalvik VMs or ART runtimes manage memory allocation dynamically, flags similar to `-d` can be utilized during debugging sessions to monitor detailed logs about heap allocations and garbage collection cycles. This ensures optimal tuning when deploying native libraries alongside Java-based APK packages compiled into `.dex` files further processed by tools like Apktool mentioned earlier[^3]. #### Handling Architecture Mismatches During Deployment If encountering issues due to architecture mismatches between installed apps requiring different instruction sets—such as ARM vs ARM64—it may result in warnings logged under `PackageManager`. These messages indicate potential conflicts preventing proper installation unless resolved appropriately either recompiling binaries targeting compatible architectures or ensuring all dependencies align correctly before bundling final outputs[^4]. #### Learning Resources Selection Criteria Choosing appropriate learning resources depends largely upon individual goals whether professional growth seeking better employment opportunities rapid prototyping personal projects mastery over complex systems transformation tasks among others outlined previously too[^2].
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值