Chiều dài và chiều rộng của hình chữ nhật và bán kính của hình tròn được nhập thông qua bàn phím. Viết chương trình tính diện tích & chu vi hình chữ nhật, diện tích & chu vi hình tròn l * b 2[l+b] πr2 2πr
Mã nguồn
''' Area of Rectangle=l*b Perimeter of Rectangle=2*[l+b] Area of Circule=PI*r*r[PI=3.14] Circum of a Circule=2*PI*r ''' len=int[input["Enter the Lenth of rectangle:"]] bre=int[input["Enter the Breadth of rectangle:"]] r=int[input["Enter the Redius of Circle:"]] area1=len*bre perimeter=2*[len+bre] area2=3.14*r*r circum=2*3.14*r print["Area of Rectangle =",area1] print["Perimeter of Rectangle =",perimeter] print["Area of Circle =",area2] print["Circum of Circle =",circum]
đầu ra
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44Để tải file raw Bấm vào đây
Chương trình tìm Chu vi/Chu vi hình vuông, hình chữ nhật
Cải thiện bài viết
Lưu bài viết
Thích bài viết
- Cập nhật lần cuối. 21 tháng 6 năm 2022
Cải thiện bài viết
Lưu bài viết
Chu vi của một hình bằng tổng độ dài các cạnh. Để tính chu vi hình vuông cần độ dài một cạnh vì các cạnh đều bằng nhau. Muốn tính chu vi hình chữ nhật cần biết chiều dài, chiều rộng hình chữ nhật.
Chu vi hình vuông.
Chu vi hình vuông được tính theo công thức.
C = 4 * a where a is the side length.
Ví dụ.
input: 4 output: 16 input: 3 output: 12
C++
input: 4 output: 16 input: 3 output: 1293
input: 4 output: 16 input: 3 output: 1294
input: 4 output: 16 input: 3 output: 1295
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 120
input: 4 output: 16 input: 3 output: 121
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 125
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 129
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4441
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4443
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127____32
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4447
input: 4 output: 16 input: 3 output: 127____149
C = 4 * a where a is the side length.40
________ 241 ________ 242 ________ 243
C = 4 * a where a is the side length.41
C = 4 * a where a is the side length.45
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 128
C = 4 * a where a is the side length.48
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1240
input: 4 output: 16 input: 3 output: 1241
Java
input: 4 output: 16 input: 3 output: 1242
input: 4 output: 16 input: 3 output: 1294
input: 4 output: 16 input: 3 output: 1244
input: 4 output: 16 input: 3 output: 1245
input: 4 output: 16 input: 3 output: 1246
input: 4 output: 16 input: 3 output: 1247
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123______32
input: 4 output: 16 input: 3 output: 125
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 1298
input: 4 output: 16 input: 3 output: 1299
input: 4 output: 16 input: 3 output: 127____140
input: 4 output: 16 input: 3 output: 127____3933
input: 4 output: 16 input: 3 output: 127______3935
input: 4 output: 16 input: 3 output: 12936
input: 4 output: 16 input: 3 output: 12937
input: 4 output: 16 input: 3 output: 12938
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 12942______3943
input: 4 output: 16 input: 3 output: 12944
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 12947
input: 4 output: 16 input: 3 output: 12948
input: 4 output: 16 input: 3 output: 12949
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 12951____3952
input: 4 output: 16 input: 3 output: 12953
input: 4 output: 16 input: 3 output: 12954
input: 4 output: 16 input: 3 output: 12955
input: 4 output: 16 input: 3 output: 12953
input: 4 output: 16 input: 3 output: 12957
input: 4 output: 16 input: 3 output: 12958
input: 4 output: 16 input: 3 output: 127____140
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1240
input: 4 output: 16 input: 3 output: 12963
Python3
input: 4 output: 16 input: 3 output: 12964
input: 4 output: 16 input: 3 output: 12965
input: 4 output: 16 input: 3 output: 12966
input: 4 output: 16 input: 3 output: 12967
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 1200______498
input: 4 output: 16 input: 3 output: 1202
input: 4 output: 16 input: 3 output: 125
input: 4 output: 16 input: 3 output: 1204
input: 4 output: 16 input: 3 output: 1205
input: 4 output: 16 input: 3 output: 1206
input: 4 output: 16 input: 3 output: 12948
________ 308 ________ 306 ________ 310
input: 4 output: 16 input: 3 output: 1211
input: 4 output: 16 input: 3 output: 1200
input: 4 output: 16 input: 3 output: 1213
input: 4 output: 16 input: 3 output: 12953
input: 4 output: 16 input: 3 output: 1215
input: 4 output: 16 input: 3 output: 1216
input: 4 output: 16 input: 3 output: 1217
input: 4 output: 16 input: 3 output: 1218
C#
input: 4 output: 16 input: 3 output: 1219
input: 4 output: 16 input: 3 output: 1220
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 1222
input: 4 output: 16 input: 3 output: 1246
input: 4 output: 16 input: 3 output: 1247
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127______3936
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 125
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 129
input: 4 output: 16 input: 3 output: 127____140
input: 4 output: 16 input: 3 output: 127____141
input: 4 output: 16 input: 3 output: 127______3935
input: 4 output: 16 input: 3 output: 12936
input: 4 output: 16 input: 3 output: 12937
input: 4 output: 16 input: 3 output: 1245
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4447
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 1252____353
input: 4 output: 16 input: 3 output: 12953
input: 4 output: 16 input: 3 output: 1255
input: 4 output: 16 input: 3 output: 1256
input: 4 output: 16 input: 3 output: 12953
input: 4 output: 16 input: 3 output: 1258
input: 4 output: 16 input: 3 output: 1259
input: 4 output: 16 input: 3 output: 127____140
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1263
PHP
input: 4 output: 16 input: 3 output: 1264
input: 4 output: 16 input: 3 output: 1265
input: 4 output: 16 input: 3 output: 1294
input: 4 output: 16 input: 3 output: 1267
input: 4 output: 16 input: 3 output: 123____369
input: 4 output: 16 input: 3 output: 1270
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127______38
input: 4 output: 16 input: 3 output: 1274____369
input: 4 output: 16 input: 3 output: 12949
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4441
input: 4 output: 16 input: 3 output: 1269
input: 4 output: 16 input: 3 output: 1280
________ 381 ________ 313 ________ 383
________ 384 ________ 385 ________ 386
_______241____33____369
input: 4 output: 16 input: 3 output: 1290
input: 4 output: 16 input: 3 output: 1291
input: 4 output: 16 input: 3 output: 1292
Javascript
input: 4 output: 16 input: 3 output: 1293
input: 4 output: 16 input: 3 output: 1294
input: 4 output: 16 input: 3 output: 1294
input: 4 output: 16 input: 3 output: 1267
input: 4 output: 16 input: 3 output: 1210
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 129
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4441
input: 4 output: 16 input: 3 output: 127____1405
input: 4 output: 16 input: 3 output: 127____1407
C = 4 * a where a is the side length.40
_______496____3953____243
input: 4 output: 16 input: 3 output: 1296
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44413
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44414
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44415
Đầu ra.
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.444
Độ phức tạp về thời gian. O[1]
Không gian phụ. Ô[1]
Chu vi hình chữ nhật.
Chu vi hình chữ nhật được cho bởi công thức.
C = 4 * a where a is the side length.4
Ví dụ.
input: 4 output: 16 input: 3 output: 124
C++
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44416
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44417
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44418
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 120
input: 4 output: 16 input: 3 output: 121
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44425
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44427
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 128
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44431
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 12933
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4443
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127____32
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44439
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44442
input: 4 output: 16 input: 3 output: 127____149
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44445
________ 241 ________ 242 ________ 1448
C = 4 * a where a is the side length.41
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44450
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 128
C = 4 * a where a is the side length.48
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1263
Python3
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44456
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44457
input: 4 output: 16 input: 3 output: 12966
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44459
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 1200
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44463
input: 4 output: 16 input: 3 output: 1202
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44465
input: 4 output: 16 input: 3 output: 12953
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44467
input: 4 output: 16 input: 3 output: 1204
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44469
input: 4 output: 16 input: 3 output: 1206
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44471
________ 1472 ________ 306 ________ 498
________ 308 ________ 306 ________ 1477
input: 4 output: 16 input: 3 output: 1211
input: 4 output: 16 input: 3 output: 1200
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44445
input: 4 output: 16 input: 3 output: 12953
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44482
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44483
input: 4 output: 16 input: 3 output: 1217
input: 4 output: 16 input: 3 output: 1218
Java
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44486
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44417
input: 4 output: 16 input: 3 output: 1244
input: 4 output: 16 input: 3 output: 1245
input: 4 output: 16 input: 3 output: 1246
input: 4 output: 16 input: 3 output: 1247
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127__
input: 4 output: 16 input: 3 output: 12936
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44425
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44499
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44427
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
input: 4 output: 16 input: 3 output: 1200____1463
C = 4 * a where a is the side length.408
input: 4 output: 16 input: 3 output: 127____140
input: 4 output: 16 input: 3 output: 127____3933
input: 4 output: 16 input: 3 output: 127______3936
input: 4 output: 16 input: 3 output: 12935
input: 4 output: 16 input: 3 output: 12937
C = 4 * a where a is the side length.417
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
C = 4 * a where a is the side length.422
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44471
C = 4 * a where a is the side length.424
input: 4 output: 16 input: 3 output: 1298
input: 4 output: 16 input: 3 output: 12949
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44442
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 12951____3952
input: 4 output: 16 input: 3 output: 12953
________ 358 ________ 2435 ________ 2436
input: 4 output: 16 input: 3 output: 127____140
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1263
C#
C = 4 * a where a is the side length.441
C = 4 * a where a is the side length.442
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 1222
input: 4 output: 16 input: 3 output: 1246
input: 4 output: 16 input: 3 output: 1247
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127__
input: 4 output: 16 input: 3 output: 12936
input: 4 output: 16 input: 3 output: 122
input: 4 output: 16 input: 3 output: 123
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44425
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44499
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44427
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44431
input: 4 output: 16 input: 3 output: 127____140
input: 4 output: 16 input: 3 output: 127____3933
input: 4 output: 16 input: 3 output: 127__
input: 4 output: 16 input: 3 output: 12936
input: 4 output: 16 input: 3 output: 12935
input: 4 output: 16 input: 3 output: 12937
input: 4 output: 16 input: 3 output: 1245
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44439
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 122
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44442
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 1252____3952
input: 4 output: 16 input: 3 output: 12953
________ 2483 ________ 2435 ________ 2436
input: 4 output: 16 input: 3 output: 127____140
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 1263
PHP
input: 4 output: 16 input: 3 output: 1264
C = 4 * a where a is the side length.491
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44417
input: 4 output: 16 input: 3 output: 1267
input: 4 output: 16 input: 3 output: 123____2495______386
C = 4 * a where a is the side length.497
input: 4 output: 16 input: 3 output: 1270
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 127______38
input: 4 output: 16 input: 3 output: 12402
C = 4 * a where a is the side length.495
input: 4 output: 16 input: 3 output: 12953
C = 4 * a where a is the side length.497______3406
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.4440
input: 4 output: 16 input: 3 output: 12933
C = 4 * a where a is the side length.495
input: 4 output: 16 input: 3 output: 12410
C = 4 * a where a is the side length.497
input: 4 output: 16 input: 3 output: 12412
input: 4 output: 16 input: 3 output: 12413
input: 4 output: 16 input: 3 output: 12414
C = 4 * a where a is the side length.495
input: 4 output: 16 input: 3 output: 1286
C = 4 * a where a is the side length.497
input: 4 output: 16 input: 3 output: 1290
________ 381 ________ 313 ________ 383
input: 4 output: 16 input: 3 output: 12422
input: 4 output: 16 input: 3 output: 12423
input: 4 output: 16 input: 3 output: 1286
input: 4 output: 16 input: 3 output: 12413
input: 4 output: 16 input: 3 output: 1286
input: 4 output: 16 input: 3 output: 12427
input: 4 output: 16 input: 3 output: 12949
input: 4 output: 16 input: 3 output: 12429
input: 4 output: 16 input: 3 output: 1292
Javascript
input: 4 output: 16 input: 3 output: 1293
input: 4 output: 16 input: 3 output: 12432
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44417
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 1267
input: 4 output: 16 input: 3 output: 12436
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 126
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 128
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44431
input: 4 output: 16 input: 3 output: 127____140
input: 4 output: 16 input: 3 output: 127____3933
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 12447
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44439
input: 4 output: 16 input: 3 output: 1296
input: 4 output: 16 input: 3 output: 12447
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44442
input: 4 output: 16 input: 3 output: 1296
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44407______3952
input: 4 output: 16 input: 3 output: 12953
C = 4 * a where a is the side length.435
C = 4 * a where a is the side length.436
input: 4 output: 16 input: 3 output: 127
input: 4 output: 16 input: 3 output: 12459
Enter the Lenth of rectangle:10 Enter the Breadth of rectangle:12 Enter the Redius of Circle:23 Area of Rectangle = 120 Perimeter of Rectangle = 44 Area of Circle = 1661.06 Circum of Circle = 144.44415
Đầu ra.
input: 4 output: 16 input: 3 output: 129
Độ phức tạp về thời gian. O[1]
Không gian phụ. O[1]
Khuyến khích
Giải các bài toán DSA trên GfG Practice
Giải quyết vấn đề
Ghi chú cá nhân của tôi arrow_drop_up
Tiết kiệm